2 import {Dictionary} from "app/utils";
4 interface ICacheService {
6 set(key:string, value:any):void;
9 export class CacheService implements ICacheService {
11 private storage:Dictionary<string, any>;
14 this.storage = new Dictionary<string, any>();
17 public get = (key:string):any => {
18 return this.storage.getValue(key);
21 public set = (key:string, value:any):void => {
22 this.storage.setValue(key, value);
25 public remove = (key:string):void => {
26 if (this.storage.containsKey(key)) {
27 this.storage.remove(key);
31 public contains = (key:string):boolean => {
32 return this.storage.containsKey(key);