0.1.0 • Published 6 years ago

@webacad/ng-store v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

NPM version Build Status

WebACAD/NgStore

Store wrapper for angular.

Dependencies

  • @angular/core
  • store

Installation

$ npm install --save @webacad/ng-store

or with yarn

$ yarn add @webacad/ng-store

Register the module

import {NgModule} from '@angular/core';
import {NgStoreModule} from '@webacad/ng-store';

@NgModule({
    imports: [
        NgStoreModule,
    ],
})
export class AppModule {}

Usage

Simply inject the NgStore service into your class:

import {NgStore} from '@webacad/ng-store';

export class AuthService
{
    
    constructor(
        private $store: NgStore,
    ) {}
    
}

Available methods:

  • get(key, default): Returns the value from store
  • set(key, value): Store a new value
  • remove(key): Remove value from the store