import { AppState , store } from '@/store' ; import { Action } from 'unistore' ; export const mergeState = < T > ( moduleName ) => ( changedState ) : Partial < AppState > => ( { [ moduleName ] : { ... store . getState ( ) [ moduleName ] , ... changedState } , } ) ; export const callAfterReturn = ( callback ) : void => { setTimeout ( ( ) : void => { callback ( ) ; } ) ; } ; export const callAction = ( action , ... args ) : Promise < void > | void => { return store . action ( action ) ( ... args ) ; } ;