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

自己写了一个函数式的状态管理器,欢迎大家提意见

  •  
  •   foomorrow · Dec 6, 2015 · 2958 views
    This topic created in 3805 days ago, the information mentioned may be changed or developed.

    https://www.npmjs.com/package/realloc
    https://github.com/foomorrow/realloc

    Api 是参考 Redux 的,基于 JSONPath 格式访问和修改当前状态的属性,每次修改会自动创建一个新的 state ,保证不可变性,状态里的所有层级的引用值可直接用 === 判断相等,无需担心修改原值的情况出现。

    Redux 的缺点主要还是调用繁琐,所以才造了这个轮子。

    目前狂补使用文档中。。。

    可以先看看 TodoMVC 例子 https://github.com/foomorrow/realloc/tree/master/examples/todomvc

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   964 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 19:53 · PVG 03:53 · LAX 12:53 · JFK 15:53
    ♥ Do have faith in what you're doing.