export interface IStoreObject { [id: string]: T; } export default class Store { private _store: IStoreObject = {}; add (id: string, data): void { this._store[id] = data; } remove (id: string): void { delete this._store[id]; } get (id: string): T { return this._store[id]; } exists (id: string): boolean { return !!this._store[id]; } count (): number { return Object.keys(this._store).length; } getAllKeys (): string[] { return Object.keys(this._store); } getAll (): IStoreObject { return this._store; } };