V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zaeneas
V2EX  ›  React

一个用来减少 Redux Boilerplate 的包,支持异步 actions

  •  
  •   zaeneas · 2017-09-10 21:10:58 +08:00 · 1911 次点击
    这是一个创建于 2391 天前的主题,其中的信息可能已经有所发展或是发生改变。
    因为即使使用 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。
    2 条回复    2017-09-11 10:14:53 +08:00
    zaeneas
        1
    zaeneas  
    OP
       2017-09-11 04:09:45 +08:00
    另外求 feedback 求 issue 求 stars
    doublleft
        2
    doublleft  
       2017-09-11 10:14:53 +08:00
    高产
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1001 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:53 · PVG 03:53 · LAX 12:53 · JFK 15:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.