Skip to content

LocalStorage built-in plugin

Import

typescript
import localstorage from '@biruni/built-in/localstorage';
Alternative Import Syntax
typescript
import localstorage from '@biruni/built-in/localstorage/mod';

typescript
import { localstorage } from '@biruni/built-in/mod';

typescript
import { localstorage } from '@biruni/built-in';

Also it's available in biruni as battery-included


typescript
import { localstorage } from 'biruni';

typescript
import { localstorage } from 'biruni/built-in';

typescript
import { localstorage } from 'biruni/localstorage';

typescript
import localstorage from 'biruni/localstorage';

TIP

The localstorage plugin also aliased to LocalStoragePlugin named export

Plug and Use

typescript
.plug(localstorage('my-localStorage-key'))

Or also can be use aliased name, by:

typescript
.plug(LocalStoragePlugin('my-localStorage-key'))
Signature
typescript
const localstorage = (key: string) => () => Context.Persister;
Information
Type🧩 Persister
Polyfill-inlcuded🚧 WORK IN PROGRESS
SSR Supportation🚧 WORK IN PROGRESS
Cross-Runtime🚧 WORK IN PROGRESS
Implemented Of🟢 DOM Storage API

Released under the GPLv3-only License