V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
zaeneas
V2EX  ›  React

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

  •  
  •   zaeneas · Sep 10, 2017 · 2805 views
    This topic created in 3161 days ago, the information mentioned may be changed or developed.
    因为即使使用 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 replies    2017-09-11 10:14:53 +08:00
    zaeneas
        1
    zaeneas  
    OP
       Sep 11, 2017
    另外求 feedback 求 issue 求 stars
    doublleft
        2
    doublleft  
       Sep 11, 2017
    高产
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1146 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 23:07 · PVG 07:07 · LAX 16:07 · JFK 19:07
    ♥ Do have faith in what you're doing.