@dlcs/provider-local-storage
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

DLCS LocalStorage Provider

status npm

Resource provider for HTML5 localStorage.

Configuration

Name Default value Usage
root.local 'DLCS' LocalStorage root name
SerializableNode.set(StorageProtocol.config, StorageProtocol.configKeys.root.name, 'DLCS');

Supported protocol

  • local for access localStorage.

Request parameters

No parameter.

Supported mode

Protocol Asynchronized Synchronized Request Submit Delete
local

Injectors

Timepoint Data structure Data description Request method
BeforeSend SerializableNode<any> Storage node Request/Submit/Delete
AfterSent SerializableNode<any> Storage node Request/Submit/Delete

Example

resourceManager.registerProtocol(new StorageProtocol());
// Save value
resourceManager.request.to(`local:///user/state/token`).submit('test').tag('user_token').send();
// Read value
const value = resourceManager.request.to(`local:///user/state/token`).tag('user_token_read').requireSync<string>();

Readme

Keywords

none

Package Sidebar

Install

npm i @dlcs/provider-local-storage

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

13.2 kB

Total Files

13

Last publish

Collaborators

  • lundarl_gholoi