Ninja Power Manifesto

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

    1.0.0 • Public • Published

    Web Storage API for Angular

    Part of Web APIs for Angular

    npm version npm bundle size .github/workflows/ci.yml Coveralls github angular-open-source-starter

    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

    Open-source

    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.

    Install

    npm i @ng-web-apis/storage

    DownloadsWeekly Downloads

    23

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    74.5 kB

    Total Files

    30

    Last publish

    Collaborators

    • marsibarsi
    • waterplea
    • vladimir.potekhin
    • defenderbass