Store wrapper for angular.
@angular/core
store
$ npm install --save @webacad/ng-store
or with yarn
$ yarn add @webacad/ng-store
import {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