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
| Parameter | Type | Description |
|---|---|---|
options | LocalStorageProviderOptions | The storage key, the storage area and the provider name. |
Returns
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' })] });