From df98563e2104b82b119c00a3cd83cd0dc1242d25 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jun 2017 14:32:15 +0200 Subject: Use typescript standard and lint all files --- client/src/app/app.service.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'client/src/app/app.service.ts') diff --git a/client/src/app/app.service.ts b/client/src/app/app.service.ts index a7eb880a4..abffc87f1 100644 --- a/client/src/app/app.service.ts +++ b/client/src/app/app.service.ts @@ -1,46 +1,48 @@ -import { Injectable } from '@angular/core'; +/* tslint:disable */ + +import { Injectable } from '@angular/core' export type InternalStateType = { [key: string]: any -}; +} @Injectable() export class AppState { - public _state: InternalStateType = { }; + public _state: InternalStateType = { } /** * Already return a clone of the current state. */ public get state() { - return this._state = this._clone(this._state); + return this._state = this._clone(this._state) } /** * Never allow mutation */ public set state(value) { - throw new Error('do not mutate the `.state` directly'); + throw new Error('do not mutate the `.state` directly') } public get(prop?: any) { /** * Use our state getter for the clone. */ - const state = this.state; - return state.hasOwnProperty(prop) ? state[prop] : state; + const state = this.state + return state.hasOwnProperty(prop) ? state[prop] : state } public set(prop: string, value: any) { /** * Internally mutate our state. */ - return this._state[prop] = value; + return this._state[prop] = value } private _clone(object: InternalStateType) { /** * Simple object clone. */ - return JSON.parse(JSON.stringify( object )); + return JSON.parse(JSON.stringify( object )) } } -- cgit v1.2.3