Class: FlyzeLocalStorageProvider
@flyze/lib-core-angular 1.0.0-alpha.34· latestDefined in: projects/lib-core-angular/src/lib/modules/storage/web-storage.providers.ts:128
Stores values in localStorage: they survive a reload, a tab close and a browser restart.
The default location — FlyzeStorageService sends every key here that no route claims.
Note that localStorage is shared by every tab of the origin and by every person using the
browser profile, so anything user-specific belongs behind a provider that binds it to the
signed-in user — one the app supplies, since identity is not this library’s business. The worked
example is in docs/guides/storing-client-state.md.
Safari/iOS may evict script-writable storage after roughly seven days of non-use for a non-installed web app; an evicted entry simply reads back as absent.
Extends
Section titled “Extends”WebStorageProvider
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FlyzeLocalStorageProvider():
FlyzeLocalStorageProvider
Returns
Section titled “Returns”FlyzeLocalStorageProvider
Inherited from
Section titled “Inherited from”WebStorageProvider.constructor
Methods
Section titled “Methods”delete()
Section titled “delete()”delete(
key):Promise<void>
Defined in: projects/lib-core-angular/src/lib/modules/storage/web-storage.providers.ts:65
Removes the entry for a key.
Parameters
Section titled “Parameters”string
The full key, prefix included.
Returns
Section titled “Returns”Promise<void>
Resolves once removed, or once the delete has been dropped.
Inherited from
Section titled “Inherited from”WebStorageProvider.delete
read()
Section titled “read()”read<
T>(key):Promise<T>
Defined in: projects/lib-core-angular/src/lib/modules/storage/web-storage.providers.ts:22
Reads and parses the entry for a key.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”string
The full key, prefix included.
Returns
Section titled “Returns”Promise<T>
The parsed value, or null if absent, corrupt or unreadable.
Inherited from
Section titled “Inherited from”WebStorageProvider.read
resolveStorage()
Section titled “resolveStorage()”
protectedresolveStorage():Storage
Defined in: projects/lib-core-angular/src/lib/modules/storage/web-storage.providers.ts:132
Returns
Section titled “Returns”Storage
localStorage, or undefined where it does not exist.
Overrides
Section titled “Overrides”WebStorageProvider.resolveStorage
write()
Section titled “write()”write(
key,value):Promise<void>
Defined in: projects/lib-core-angular/src/lib/modules/storage/web-storage.providers.ts:45
Serializes a value and stores it under a key.
Parameters
Section titled “Parameters”string
The full key, prefix included.
unknown
Any JSON-serializable value.
Returns
Section titled “Returns”Promise<void>
Resolves once stored, or once the write has been dropped.
Inherited from
Section titled “Inherited from”WebStorageProvider.write