@ng-web-apis/storage
TypeScript icon, indicating that this package has built-in type declarations

3.0.6 • Public • Published

ng-web-apis logo Web Storage API for Angular

npm version npm bundle size codecov

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/common

Now install the package:

npm i @ng-web-apis/storage

How to use

Web Storage API consists of storage synthesis and storage recognition.

  1. Use STORAGE_EVENT token to inject an Observable of StorageEvent.
  2. Use filterByKey and toValue utility operators to work with this Observable.
  3. Native StorageEvent only fires when changes are made from another tab. To capture events from the same tab use StorageService to work with localStorage

See demo for concrete usage example.

See also

Other Web APIs for Angular by @ng-web-apis

Package Sidebar

Install

npm i @ng-web-apis/storage

Weekly Downloads

676

Version

3.0.6

License

Apache-2.0

Unpacked Size

47.5 kB

Total Files

20

Last publish

Collaborators

  • marsibarsi
  • waterplea
  • vladimir.potekhin
  • defenderbass