"use strict" ; import { Store } from "almin" ; let storeCount = 0 ; export interface MockStore < T > extends Store < T > { updateStateWithoutEmit ( newState ) : void ; updateState ( newState ) : void ; getState ( ) : any ; } example export function createStore < T > ( storeName , initialState ) ; export function createStore < T > ( initialState ) ; export function createStore < T > ( ... args ) { class MockStoreImpl extends Store < T > implements MockStore < T > { state : T ; name : string ; constructor ( ) { super ( ) ; storeCount ++ ; if ( typeof args [ 0 ] === "string" ) { this . name = args [ 0 ] ; this . state = args [ 1 ] ; } else { this . name = `MockStore<${ storeCount }>` ; this . state = args [ 0 ] ; } } /**
         * Update state without emitting
         */ updateStateWithoutEmit ( newState ) { this . state = newState ; } /**
         * Update Store's state
         * alias to setState
         */ updateState ( newState ) { this . setState ( newState ) ; } /**
         * Return current state
         */ getState ( ) { return this . state ; } } return new MockStoreImpl ( ) ; }