dispatcher 简单介绍

June 23, 2018 · View on GitHub

action 的结构遵循一定规范,以这个为前提,派发方式就可以更简洁

dispatch({
    type: 'app/fetch',
    payload: {
        id: 1
    }
}).then(...)

// =>

dispatcher.app.fetch({ id: 1 }).then(...)