marty.js v0.9 发布,React 状态管理库

jopen 9年前

marty.js 用来为 React 应用提供状态管理的 JavaScript 库,实现了 Flux architecture. 定义了一组规则用来管理应用的状态。Flux 是 非死book 推出的用来帮助他们自己构建客户端 web 应用。

marty.js v0.9 发布,此版本关键的改进是:Store#setState 重命名为 Store#replaceStateStore#setState 现在会和新状态合并到现有状态中,这非常接近 React API。

新特性

  • Isomorphism (#13)

  • CookieStateSource & LocationStateSource (#205)

  • ES6 Classes (#89)

  • Add dataType option to http state source (#176)

  • Lodash v3 instead of underscore (#170)

  • HttpStateSource hooks (#118)

  • FetchResult#toPromise (#180)

  • Clear fetch history in Store#clear (#149)

  • Batch store change events (#183)

  • Allow you to specify when function context (#184)

  • Marty.createContainer (#206)

  • Set request credentials to 'same-origin' (#209)

Bugs 修复

  • dependsOn doesn't update when dependent store updates (#113)

  • Don't auto set content-type if using FormData (#140)

  • Fetch API compatibility (#133)

更多详细新特性解说请看发行说明