0.1.0 • Published 7 years ago
@webacad/ng-store v0.1.0
WebACAD/NgStore
Store wrapper for angular.
Dependencies
@angular/corestore
Installation
$ npm install --save @webacad/ng-storeor with yarn
$ yarn add @webacad/ng-storeRegister 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 storeset(key, value): Store a new valueremove(key): Remove value from the store