Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.6 KB

README.md

File metadata and controls

39 lines (26 loc) · 1.6 KB

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