foomorrow
V2EX  ›  React

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

  •  
  •   foomorrow · Dec 6, 2015 · 3051 views
    This topic created in 3851 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   ·   2527 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 16:01 · PVG 00:01 · LAX 09:01 · JFK 12:01
    ♥ Do have faith in what you're doing.