Attention! This repository is archived and the library has been moved to tinkoff/ng-web-apis monorepository
Part of Web APIs for Angular
This is a library to use Web Storage API with Angular.
If you do not have @ng-web-apis/common:
npm i @ng-web-apis/common
Now install the package:
npm i @ng-web-apis/storage
Web Storage API consists of storage synthesis and storage recognition.
- Use
STORAGE_EVENT
token to inject anObservable
ofStorageEvent
. - Use
filterByKey
andtoValue
utility operators to work with thisObservable
. - Native
StorageEvent
only fires when changes are made from another tab. To capture events from the same tab useStorageService
to work withlocalStorage
See demo for concrete usage example.
Other Web APIs for Angular by @ng-web-apis
Do you also want to open-source something, but hate the collateral work? Check out this Angular Open-source Library Starter we’ve created for our projects. It got you covered on continuous integration, pre-commit checks, linting, versioning + changelog, code coverage and all that jazz.