mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-21 07:24:07 +01:00
chore(build): dependencies and config updates
This commit is contained in:
parent
1ba236a067
commit
04a57b7b98
11 changed files with 650 additions and 614 deletions
|
|
@ -1,8 +1,12 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
export type InteralStateType = {
|
||||
[key: string]: any
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
export class AppState {
|
||||
_state = { };
|
||||
_state: InteralStateType = {};
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
|
@ -11,6 +15,7 @@ export class AppState {
|
|||
get state() {
|
||||
return this._state = this._clone(this._state);
|
||||
}
|
||||
|
||||
// never allow mutation
|
||||
set state(value) {
|
||||
throw new Error('do not mutate the `.state` directly');
|
||||
|
|
@ -29,8 +34,8 @@ export class AppState {
|
|||
}
|
||||
|
||||
|
||||
_clone(object) {
|
||||
private _clone(object: InteralStateType) {
|
||||
// simple object clone
|
||||
return JSON.parse(JSON.stringify( object ));
|
||||
return JSON.parse(JSON.stringify(object));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue