Skip to content

Function: localStorageProvider() ​

ts
function localStorageProvider(options): ConfigProvider;

Defined in: providers/local-storage.ts:52

Create a provider that keeps the configuration document in Web Storage.

Parameters ​

ParameterTypeDescription
optionsLocalStorageProviderOptionsThe storage key, the storage area and the provider name.

Returns ​

ConfigProvider

A provider that can load, save and subscribe.

Remarks ​

Storage errors and JSON that is not valid give null. A value that is not a configuration document makes load reject. Other tabs send changes through the storage event.

Example ​

ts
createWand({ providers: [localStorageProvider({ key: 'wand' })] });