chore(build): dependencies and config updates

This commit is contained in:
nixa 2016-09-19 16:51:05 +03:00
parent 1ba236a067
commit 04a57b7b98
11 changed files with 650 additions and 614 deletions

View file

@ -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));
}
}