Store wrapper for angular.
@angular/corestore
$ npm install --save @webacad/ng-storeor with yarn
$ yarn add @webacad/ng-storeimport {NgModule} from '@angular/core';
import {NgStoreModule} from '@webacad/ng-store';
@NgModule({
imports: [
NgStoreModule,
],
})
export class AppModule {}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