foomorrow
V2EX  ›  React

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

  •  
  •   foomorrow · Dec 6, 2015 · 3004 views
    This topic created in 3822 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   ·   5152 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 466ea39e · 109ms · UTC 05:40 · PVG 13:40 · LAX 22:40 · JFK 01:40
    ♥ Do have faith in what you're doing.