charton API / @chart-on/core / index / LocalStorageAdapterOptions
Interface: LocalStorageAdapterOptions
Defined in: packages/core/src/storage/local.ts:14
Options for createLocalStorageAdapter: the key prefix, the Web Storage object to use, and an error hook.
Properties
onError?
optionalonError?: (error,key) =>void
Defined in: packages/core/src/storage/local.ts:23
Called when a read or write fails (blocked storage, quota full) or a corrupt entry is dropped. Failures never throw; without this they are silent.
Parameters
error
unknown
key
string
Returns
void
prefix?
optionalprefix?:string
Defined in: packages/core/src/storage/local.ts:16
Prepended to every key. Default 'charton:'; give each app or chart on a domain its own.
storage?
optionalstorage?:KeyValueStorage
Defined in: packages/core/src/storage/local.ts:18
The store to use. Default localStorage; sessionStorage or an in-memory stand-in also work.