@ng-web-apis/storage
v4.12.2
Published
A library to use Web Storage API with Observables
Readme
Web Storage API for Angular
This is a library to use Web Storage API with Angular.
Install
If you do not have @ng-web-apis/common:
npm i @ng-web-apis/commonNow install the package:
npm i @ng-web-apis/storageHow to use
Web Storage API consists of storage synthesis and storage recognition.
- Use
STORAGE_EVENTtoken to inject anObservableofStorageEvent. - Use
filterByKeyandtoValueutility operators to work with thisObservable. - Native
StorageEventonly fires when changes are made from another tab. To capture events from the same tab useStorageServiceto work withlocalStorage
See demo for concrete usage example.
See also
Other Web APIs for Angular by @ng-web-apis
