[go: up one dir, main page]

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

4.11.1 • 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

860

Version

4.11.1

License

Apache-2.0

Unpacked Size

35.6 kB

Total Files

17

Last publish

Collaborators

  • marsibarsi
  • waterplea
  • vladimir.potekhin
  • defenderbass