import Manager from './manager' ; import cloneDeep from 'lodash.clonedeep' ; import { IAction } from './transitions' ; export default class StoreManager { private _m : Manager ; private _store : any = { } ; constructor ( m ) { this . _m = m ; } public get = ( ) : any => cloneDeep ( this . _store ) ; public manager = ( ) => this . _m ; public reset = ( ) => this . _store = { } ; public set = ( o ) => this . _store = Object . assign ( { } , this . get ( ) , o ) ; public node = ( key ) : any => this . get ( ) [ key ] ; public dispatch = ( action ) => { this . manager ( ) . transitions ( ) . execute ( action ) ; this . manager ( ) . subscribers ( ) . notify ( ) ; } ; }