import { IMap , IReceiveMsg , TRoute } from './typing' ; /**
 * actor
 *
 * 借鉴MapReduce的理念，store负责分派，actor负责处理
 */ export default class Actor { constructor ( ) { this . _route = this . _route || { } ; } private _route : TRoute ; defaultState ( ) { return { } ; } param msg param state param params receive ( { msg , state , params } ) { const fn = this . _route [ msg ] ; return fn ? fn . call ( this , state , params ) : state ; } }