首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

redux-1.0.1.zip

前端 155.91KB 15 需要积分: 1
立即下载

资源介绍:

一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
# [Redux](http://rackt.github.io/redux) Redux is a predictable state container for JavaScript apps. It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as [live code editing combined with a time traveling debugger](https://github.com/gaearon/redux-devtools). You can use Redux together with [React](https://facebook.github.io/react/), or with any other view library. It is tiny (2kB) and has no dependencies. [![build status](https://img.shields.io/travis/rackt/redux/master.svg?style=flat-square)](https://travis-ci.org/rackt/redux) [![npm version](https://img.shields.io/npm/v/redux.svg?style=flat-square)](https://www.npmjs.com/package/redux) [![npm downloads](https://img.shields.io/npm/dm/redux.svg?style=flat-square)](https://www.npmjs.com/package/redux) [![redux channel on slack](https://img.shields.io/badge/slack-redux@reactiflux-61DAFB.svg?style=flat-square)](http://www.reactiflux.com) ### Testimonials >[“Love what you’re doing with Redux”](https://twitter.com/jingc/status/616608251463909376) >Jing Chen, creator of Flux >[“I asked for comments on Redux in FB's internal JS discussion group, and it was universally praised. Really awesome work.”](https://twitter.com/fisherwebdev/status/616286955693682688) >Bill Fisher, creator of Flux >[“It's cool that you are inventing a better Flux by not doing Flux at all.”](https://twitter.com/andrestaltz/status/616271392930201604) >André Staltz, creator of Cycle ### Developer Experience I wrote Redux while working on my React Europe talk called [“Hot Reloading with Time Travel”](https://www.youtube.com/watch?v=xsSnOQynTHs). My goal was to create a state management library with minimal API but completely predictable behavior, so it is possible to implement logging, hot reloading, time travel, universal apps, record and replay, without any buy-in from the developer. ### Influences Redux evolves the ideas of [Flux](https://facebook.github.io/flux), but avoids its complexity by taking cues from [Elm](http://elm-lang.org/guide/architecture). Whether you used them or not, Redux takes a few minutes to get started with. ### Installation To install the stable version: ``` npm install --save redux ``` Most likely, you’ll also need [the React bindings](http://github.com/gaearon/react-redux) and [the developer tools](http://github.com/gaearon/redux-devtools). ``` npm install --save react-redux npm install --save-dev redux-devtools ``` ### The Gist The whole state of your app is stored in an object tree inside a single *store*. The only way to change the state tree is to emit an *action*, an object describing what happened. To specify how the actions transform the state tree, you write pure *reducers*. That’s it! ```js import { createStore } from 'redux'; /** * This is a reducer, a pure function with (state, action) => state signature. * It describes how an action transforms the state into the next state. * * The shape of the state is up to you: it can be a primitive, an array, an object, * or even an Immutable.js data structure. The only important part is that you should * not mutate the state object, but return a new object if the state changes. * * In this example, we use a `switch` statement and strings, but you can use a helper that * follows a different convention (such as function maps) if it makes sense for your project. */ function counter(state = 0, action) { switch (action.type) { case 'INCREMENT': return state + 1; case 'DECREMENT': return state - 1; default: return state; } } // Create a Redux store holding the state of your app. // Its API is { subscribe, dispatch, getState }. let store = createStore(counter); // You can subscribe to the updates manually, or use bindings to your view layer. store.subscribe(() => console.log(store.getState()) ); // The only way to mutate the internal state is to dispatch an action. // The actions can be serialized, logged or stored and later replayed. store.dispatch({ type: 'INCREMENT' }); // 1 store.dispatch({ type: 'INCREMENT' }); // 2 store.dispatch({ type: 'DECREMENT' }); // 1 ``` Instead of mutating the state directly, you specify the mutations you want to happen with plain objects called *actions*. Then you write a special function called a *reducer* to decide how every action transforms the entire application’s state. If you’re coming from Flux, there is a single important difference you need to understand. Redux doesn’t have a Dispatcher or support many stores. Instead, there is just a single store with a single root reducing function. As your app grows, instead of adding stores, you split the root reducer into smaller reducers independently operating on the different parts of the state tree. This is exactly like there is just one root component in a React app, but it is composed out of many small components. This architecture might seem like an overkill for a counter app, but the beauty of this pattern is how well it scales to large and complex apps. It also enables very powerful developer tools, because it is possible to trace every mutation to the action that caused it. You can record user sessions and reproduce them just by replaying every action. ### Documentation * [Introduction](http://rackt.github.io/redux/docs/introduction/index.html) * [Basics](http://rackt.github.io/redux/docs/basics/index.html) * [Advanced](http://rackt.github.io/redux/docs/advanced/index.html) * [Recipes](http://rackt.github.io/redux/docs/recipes/index.html) * [Troubleshooting](http://rackt.github.io/redux/docs/Troubleshooting.html) * [Glossary](http://rackt.github.io/redux/docs/Glossary.html) * [API Reference](http://rackt.github.io/redux/docs/api/index.html) ### Examples * [Counter](http://rackt.github.io/redux/docs/introduction/Examples.html#counter) ([source](https://github.com/rackt/redux/tree/master/examples/counter)) * [TodoMVC](http://rackt.github.io/redux/docs/introduction/Examples.html#todomvc) ([source](https://github.com/rackt/redux/tree/master/examples/todomvc)) * [Async](http://rackt.github.io/redux/docs/introduction/Examples.html#async) ([source](https://github.com/rackt/redux/tree/master/examples/async)) * [Real World](http://rackt.github.io/redux/docs/introduction/Examples.html#real-world) ([source](https://github.com/rackt/redux/tree/master/examples/real-world)) ### Discussion Join the **#redux** channel of the [Reactiflux](http://reactiflux.com) Slack community. ### Thanks * [The Elm Architecture](https://github.com/evancz/elm-architecture-tutorial) for a great intro to modeling state updates with reducers; * [Turning the database inside-out](http://blog.confluent.io/2015/03/04/turning-the-database-inside-out-with-apache-samza/) for blowing my mind; * [Developing ClojureScript with Figwheel](http://www.youtube.com/watch?v=j-kj2qwJa_E) for convincing me that re-evaluation should “just work”; * [Webpack](https://github.com/webpack/docs/wiki/hot-module-replacement-with-webpack) for Hot Module Replacement; * [Flummox](https://github.com/acdlite/flummox) for teaching me to approach Flux without boilerplate or singletons; * [disto](https://github.com/threepointone/disto) for a proof of concept of hot reloadable Stores; * [NuclearJS](https://github.com/optimizely/nuclear-js) for proving this architecture can be performant; * [Om](https://github.com/omcljs/om) for popularizing the idea of a single state atom; * [Cycle](https://github.com/staltz/cycle) for showing how often a function is the best tool; * [React](https://github.com/facebook/react) for the pragmatic innovation. Special thanks to [Jamie Paton](http://jdpaton.github.io) for handing over the `redux` NPM package name. ### Patrons The work on Redux was [funded by the community](https://www.patreon.com/reactdx). Meet some of the outstanding companies th

资源文件列表:

redux-1.0.1.zip 大约有199个文件
  1. redux-1.0.1/
  2. redux-1.0.1/.babelrc 35B
  3. redux-1.0.1/.eslintignore 201B
  4. redux-1.0.1/.eslintrc 585B
  5. redux-1.0.1/.flowconfig 54B
  6. redux-1.0.1/.gitignore 53B
  7. redux-1.0.1/.npmignore 60B
  8. redux-1.0.1/.travis.yml 114B
  9. redux-1.0.1/CHANGELOG.md 18.53KB
  10. redux-1.0.1/CODE_OF_CONDUCT.md 1.39KB
  11. redux-1.0.1/LICENSE.md 1.05KB
  12. redux-1.0.1/PATRONS.md 639B
  13. redux-1.0.1/README.md 7.97KB
  14. redux-1.0.1/book.json 53B
  15. redux-1.0.1/docs/
  16. redux-1.0.1/docs/Glossary.md 8.16KB
  17. redux-1.0.1/docs/README.md 1.62KB
  18. redux-1.0.1/docs/Troubleshooting.md 6.04KB
  19. redux-1.0.1/docs/advanced/
  20. redux-1.0.1/docs/advanced/AsyncActions.md 18.02KB
  21. redux-1.0.1/docs/advanced/AsyncFlow.md 1.35KB
  22. redux-1.0.1/docs/advanced/ExampleRedditAPI.md 7.54KB
  23. redux-1.0.1/docs/advanced/Middleware.md 16.81KB
  24. redux-1.0.1/docs/advanced/NextSteps.md 103B
  25. redux-1.0.1/docs/advanced/README.md 421B
  26. redux-1.0.1/docs/advanced/UsageWithReactRouter.md 116B
  27. redux-1.0.1/docs/api/
  28. redux-1.0.1/docs/api/README.md 1.29KB
  29. redux-1.0.1/docs/api/Store.md 7.71KB
  30. redux-1.0.1/docs/api/applyMiddleware.md 9.2KB
  31. redux-1.0.1/docs/api/bindActionCreators.md 3.92KB
  32. redux-1.0.1/docs/api/combineReducers.md 3.83KB
  33. redux-1.0.1/docs/api/compose.md 2.02KB
  34. redux-1.0.1/docs/api/createStore.md 2.83KB
  35. redux-1.0.1/docs/basics/
  36. redux-1.0.1/docs/basics/Actions.md 4.56KB
  37. redux-1.0.1/docs/basics/DataFlow.md 4.83KB
  38. redux-1.0.1/docs/basics/ExampleTodoList.md 6.6KB
  39. redux-1.0.1/docs/basics/README.md 500B
  40. redux-1.0.1/docs/basics/Reducers.md 13.85KB
  41. redux-1.0.1/docs/basics/Store.md 2.92KB
  42. redux-1.0.1/docs/basics/UsageWithReact.md 11.95KB
  43. redux-1.0.1/docs/introduction/
  44. redux-1.0.1/docs/introduction/Ecosystem.md 2.67KB
  45. redux-1.0.1/docs/introduction/Examples.md 2.26KB
  46. redux-1.0.1/docs/introduction/Motivation.md 2.19KB
  47. redux-1.0.1/docs/introduction/PriorArt.md 7.02KB
  48. redux-1.0.1/docs/introduction/README.md 169B
  49. redux-1.0.1/docs/introduction/ThreePrinciples.md 2.94KB
  50. redux-1.0.1/docs/recipes/
  51. redux-1.0.1/docs/recipes/ComputingDerivedData.md 6.49KB
  52. redux-1.0.1/docs/recipes/MigratingToRedux.md 2.23KB
  53. redux-1.0.1/docs/recipes/README.md 440B
  54. redux-1.0.1/docs/recipes/ReducingBoilerplate.md 16.7KB
  55. redux-1.0.1/docs/recipes/ServerRendering.md 109B
  56. redux-1.0.1/docs/recipes/WritingTests.md 6.96KB
  57. redux-1.0.1/examples/
  58. redux-1.0.1/examples/async/
  59. redux-1.0.1/examples/async/.babelrc 17B
  60. redux-1.0.1/examples/async/actions/
  61. redux-1.0.1/examples/async/actions/index.js 1.32KB
  62. redux-1.0.1/examples/async/components/
  63. redux-1.0.1/examples/async/components/Picker.js 672B
  64. redux-1.0.1/examples/async/components/Posts.js 318B
  65. redux-1.0.1/examples/async/containers/
  66. redux-1.0.1/examples/async/containers/AsyncApp.js 2.57KB
  67. redux-1.0.1/examples/async/containers/Root.js 368B
  68. redux-1.0.1/examples/async/index.html 167B
  69. redux-1.0.1/examples/async/index.js 160B
  70. redux-1.0.1/examples/async/package.json 1.03KB
  71. redux-1.0.1/examples/async/reducers/
  72. redux-1.0.1/examples/async/reducers/index.js 1.22KB
  73. redux-1.0.1/examples/async/server.js 420B
  74. redux-1.0.1/examples/async/store/
  75. redux-1.0.1/examples/async/store/configureStore.js 425B
  76. redux-1.0.1/examples/async/webpack.config.js 843B
  77. redux-1.0.1/examples/buildAll.js 1010B
  78. redux-1.0.1/examples/counter/
  79. redux-1.0.1/examples/counter/.babelrc 17B
  80. redux-1.0.1/examples/counter/actions/
  81. redux-1.0.1/examples/counter/actions/counter.js 599B
  82. redux-1.0.1/examples/counter/components/
  83. redux-1.0.1/examples/counter/components/Counter.js 822B
  84. redux-1.0.1/examples/counter/containers/
  85. redux-1.0.1/examples/counter/containers/CounterApp.js 430B
  86. redux-1.0.1/examples/counter/containers/Root.js 374B
  87. redux-1.0.1/examples/counter/index.html 169B
  88. redux-1.0.1/examples/counter/index.js 129B
  89. redux-1.0.1/examples/counter/package.json 1.08KB
  90. redux-1.0.1/examples/counter/reducers/
  91. redux-1.0.1/examples/counter/reducers/counter.js 285B
  92. redux-1.0.1/examples/counter/reducers/index.js 155B
  93. redux-1.0.1/examples/counter/server.js 420B
  94. redux-1.0.1/examples/counter/store/
  95. redux-1.0.1/examples/counter/store/configureStore.js 340B
  96. redux-1.0.1/examples/counter/test/
  97. redux-1.0.1/examples/counter/test/actions/
  98. redux-1.0.1/examples/counter/test/actions/counter.spec.js 1.34KB
  99. redux-1.0.1/examples/counter/test/components/
  100. redux-1.0.1/examples/counter/test/components/Counter.spec.js 1.68KB
  101. redux-1.0.1/examples/counter/test/containers/
  102. redux-1.0.1/examples/counter/test/containers/CounterApp.spec.js 1.81KB
  103. redux-1.0.1/examples/counter/test/jsdomReact.js 194B
  104. redux-1.0.1/examples/counter/test/reducers/
  105. redux-1.0.1/examples/counter/test/reducers/counter.spec.js 684B
  106. redux-1.0.1/examples/counter/webpack.config.js 843B
  107. redux-1.0.1/examples/real-world/
  108. redux-1.0.1/examples/real-world/.babelrc 17B
  109. redux-1.0.1/examples/real-world/actions/
  110. redux-1.0.1/examples/real-world/actions/index.js 4KB
  111. redux-1.0.1/examples/real-world/components/
  112. redux-1.0.1/examples/real-world/components/Explore.js 1.48KB
  113. redux-1.0.1/examples/real-world/components/List.js 1.14KB
  114. redux-1.0.1/examples/real-world/components/Repo.js 812B
  115. redux-1.0.1/examples/real-world/components/User.js 639B
  116. redux-1.0.1/examples/real-world/containers/
  117. redux-1.0.1/examples/real-world/containers/App.js 1.79KB
  118. redux-1.0.1/examples/real-world/containers/RepoPage.js 2.61KB
  119. redux-1.0.1/examples/real-world/containers/Root.js 821B
  120. redux-1.0.1/examples/real-world/containers/UserPage.js 2.62KB
  121. redux-1.0.1/examples/real-world/index.html 172B
  122. redux-1.0.1/examples/real-world/index.js 252B
  123. redux-1.0.1/examples/real-world/middleware/
  124. redux-1.0.1/examples/real-world/middleware/api.js 3.72KB
  125. redux-1.0.1/examples/real-world/package.json 1.02KB
  126. redux-1.0.1/examples/real-world/reducers/
  127. redux-1.0.1/examples/real-world/reducers/index.js 1.24KB
  128. redux-1.0.1/examples/real-world/reducers/paginate.js 1.72KB
  129. redux-1.0.1/examples/real-world/server.js 420B
  130. redux-1.0.1/examples/real-world/store/
  131. redux-1.0.1/examples/real-world/store/configureStore.js 589B
  132. redux-1.0.1/examples/real-world/webpack.config.js 843B
  133. redux-1.0.1/examples/testAll.js 966B
  134. redux-1.0.1/examples/todomvc/
  135. redux-1.0.1/examples/todomvc/.babelrc 17B
  136. redux-1.0.1/examples/todomvc/actions/
  137. redux-1.0.1/examples/todomvc/actions/todos.js 527B
  138. redux-1.0.1/examples/todomvc/components/
  139. redux-1.0.1/examples/todomvc/components/Footer.js 1.78KB
  140. redux-1.0.1/examples/todomvc/components/Header.js 591B
  141. redux-1.0.1/examples/todomvc/components/MainSection.js 2.2KB
  142. redux-1.0.1/examples/todomvc/components/TodoItem.js 1.66KB
  143. redux-1.0.1/examples/todomvc/components/TodoTextInput.js 1.29KB
  144. redux-1.0.1/examples/todomvc/constants/
  145. redux-1.0.1/examples/todomvc/constants/ActionTypes.js 256B
  146. redux-1.0.1/examples/todomvc/constants/TodoFilters.js 126B
  147. redux-1.0.1/examples/todomvc/containers/
  148. redux-1.0.1/examples/todomvc/containers/Root.js 413B
  149. redux-1.0.1/examples/todomvc/containers/TodoApp.js 687B
  150. redux-1.0.1/examples/todomvc/index.html 185B
  151. redux-1.0.1/examples/todomvc/index.js 191B
  152. redux-1.0.1/examples/todomvc/package.json 1.18KB
  153. redux-1.0.1/examples/todomvc/reducers/
  154. redux-1.0.1/examples/todomvc/reducers/index.js 150B
  155. redux-1.0.1/examples/todomvc/reducers/todos.js 1.18KB
  156. redux-1.0.1/examples/todomvc/server.js 420B
  157. redux-1.0.1/examples/todomvc/test/
  158. redux-1.0.1/examples/todomvc/test/actions/
  159. redux-1.0.1/examples/todomvc/test/actions/todos.spec.js 1.19KB
  160. redux-1.0.1/examples/todomvc/test/components/
  161. redux-1.0.1/examples/todomvc/test/components/Footer.spec.js 3.33KB
  162. redux-1.0.1/examples/todomvc/test/components/Header.spec.js 1.4KB
  163. redux-1.0.1/examples/todomvc/test/components/MainSection.spec.js 4.35KB
  164. redux-1.0.1/examples/todomvc/test/components/TodoItem.spec.js 3.53KB
  165. redux-1.0.1/examples/todomvc/test/components/TodoTextItem.spec.js 2.62KB
  166. redux-1.0.1/examples/todomvc/test/jsdomReact.js 194B
  167. redux-1.0.1/examples/todomvc/test/reducers/
  168. redux-1.0.1/examples/todomvc/test/reducers/todos.spec.js 4.49KB
  169. redux-1.0.1/examples/todomvc/webpack.config.js 933B
  170. redux-1.0.1/package.json 2.54KB
  171. redux-1.0.1/src/
  172. redux-1.0.1/src/createStore.js 5.11KB
  173. redux-1.0.1/src/index.js 349B
  174. redux-1.0.1/src/utils/
  175. redux-1.0.1/src/utils/applyMiddleware.js 1.19KB
  176. redux-1.0.1/src/utils/bindActionCreators.js 1.68KB
  177. redux-1.0.1/src/utils/combineReducers.js 4.39KB
  178. redux-1.0.1/src/utils/compose.js 386B
  179. redux-1.0.1/src/utils/isPlainObject.js 627B
  180. redux-1.0.1/src/utils/mapValues.js 443B
  181. redux-1.0.1/src/utils/pick.js 470B
  182. redux-1.0.1/test/
  183. redux-1.0.1/test/createStore.spec.js 7.19KB
  184. redux-1.0.1/test/helpers/
  185. redux-1.0.1/test/helpers/actionCreators.js 643B
  186. redux-1.0.1/test/helpers/actionTypes.js 134B
  187. redux-1.0.1/test/helpers/middleware.js 167B
  188. redux-1.0.1/test/helpers/reducers.js 971B
  189. redux-1.0.1/test/utils/
  190. redux-1.0.1/test/utils/applyMiddleware.spec.js 2.22KB
  191. redux-1.0.1/test/utils/bindActionCreators.spec.js 2.16KB
  192. redux-1.0.1/test/utils/combineReducers.spec.js 5.15KB
  193. redux-1.0.1/test/utils/compose.spec.js 523B
  194. redux-1.0.1/test/utils/isPlainObject.spec.js 742B
  195. redux-1.0.1/test/utils/mapValues.spec.js 331B
  196. redux-1.0.1/test/utils/pick.spec.js 322B
  197. redux-1.0.1/webpack.config.base.js 295B
  198. redux-1.0.1/webpack.config.development.js 328B
  199. redux-1.0.1/webpack.config.production.js 442B
0评论
提交 加载更多评论
其他资源 redux-2.1.1.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-3.0.1.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-3.0.0.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-3.0.2.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-2.1.2.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-2.1.0.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-1.0.0.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-1.0.0-alpha.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management