因为即使使用 redux-actions, 和 redux-act 写带 thunk 的异步操作都会很麻烦,尤其是要么写 XXX_Pending/XXX_SUCCESS/XXX_ERROR 这样的 action.type,要么写成一个 action creator 函数。因为希望能够把所有 async action 相关的放在一起,然后 async action 相关的层级和其他 actions 不一样,所以我写了这样一个包。
https://github.com/zhujinxuan/redux-declare
这个包和 redux-actions 以及 redux-act 的区别是可以在创建 action creators/ reducers 的时候加一层来代表 status,于是可以比较方便的在 reducers 接受 status 以及在 action creator 中比较方便的表示 status change。