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

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

redux-3.0.3.zip

前端 183.26KB 2 需要积分: 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 discord](https://img.shields.io/badge/discord-%23redux%20%40%20reactiflux-61dafb.svg?style=flat-square)](https://discord.gg/0ZcbPKXt5bZ6au5t) [![#rackt on freenode](https://img.shields.io/badge/irc-%23rackt%20%40%20freenode-61DAFB.svg?style=flat-square)](https://webchat.freenode.net/) ### 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](https://github.com/evancz/elm-architecture-tutorial/). Whether you have 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 ``` This assumes that you’re using [npm](http://npmjs.com/) package manager with a module bundler like [Webpack](http://webpack.github.io) or [Browserify](http://browserify.org/) to consume [CommonJS modules](http://webpack.github.io/docs/commonjs.html). If you don’t yet use [npm](http://npmjs.com/) or a modern module bundler, and would rather prefer a single-file [UMD](https://github.com/umdjs/umd) build that makes `Redux` available as a global object, you can grab a pre-built version from [cdnjs](https://cdnjs.com/libraries/redux). We *don’t* recommend this approach for any serious application, as most of the libraries complementary to Redux are only available on [npm](http://npmjs.com/). ### 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) For PDF, ePub, and MOBI exports for offline reading, and instructions on how to create them, please see: [paulkogel/redux-offline-docs](https://github.com/paulkogel/redux-offline-docs). ### 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)) * [Todos with Undo](http://rackt.github.io/redux/docs/introduction/Examples.html#todos-with-undo) ([source](https://github.com/rackt/redux/tree/master/examples/todos-with-undo)) * [Async](http://rackt.github.io/redux/docs/introduction/Examples.html#async) ([source](https://github.com/rackt/redux/tree/master/examples/async)) * [Universal](http://rackt.github.io/redux/docs/introduction/Examples.html#universal) ([source](https://github.com/rackt/redux/tree/master/examples/universal)) * [Real World](http://rackt.github.io/redux/docs/introduction/Examples.html#real-world) ([source](https://github.com/rackt/redux/tree/master/examples/real-world)) If you’re new to the NPM ecosystem and have troubles getting a pr

资源文件列表:

redux-3.0.3.zip 大约有240个文件
  1. redux-3.0.3/
  2. redux-3.0.3/.babelrc 35B
  3. redux-3.0.3/.eslintignore 69B
  4. redux-3.0.3/.eslintrc 434B
  5. redux-3.0.3/.flowconfig 54B
  6. redux-3.0.3/.gitignore 53B
  7. redux-3.0.3/.npmignore 137B
  8. redux-3.0.3/.travis.yml 130B
  9. redux-3.0.3/CHANGELOG.md 222B
  10. redux-3.0.3/CNAME 13B
  11. redux-3.0.3/CODE_OF_CONDUCT.md 1.39KB
  12. redux-3.0.3/LICENSE.md 1.05KB
  13. redux-3.0.3/PATRONS.md 803B
  14. redux-3.0.3/README.md 9.88KB
  15. redux-3.0.3/book.json 273B
  16. redux-3.0.3/docs/
  17. redux-3.0.3/docs/Glossary.md 8.07KB
  18. redux-3.0.3/docs/README.md 1.76KB
  19. redux-3.0.3/docs/Troubleshooting.md 6.02KB
  20. redux-3.0.3/docs/advanced/
  21. redux-3.0.3/docs/advanced/AsyncActions.md 19.04KB
  22. redux-3.0.3/docs/advanced/AsyncFlow.md 1.44KB
  23. redux-3.0.3/docs/advanced/ExampleRedditAPI.md 7.57KB
  24. redux-3.0.3/docs/advanced/Middleware.md 16.43KB
  25. redux-3.0.3/docs/advanced/NextSteps.md 103B
  26. redux-3.0.3/docs/advanced/README.md 421B
  27. redux-3.0.3/docs/advanced/UsageWithReactRouter.md 116B
  28. redux-3.0.3/docs/api/
  29. redux-3.0.3/docs/api/README.md 1.25KB
  30. redux-3.0.3/docs/api/Store.md 7.06KB
  31. redux-3.0.3/docs/api/applyMiddleware.md 9.75KB
  32. redux-3.0.3/docs/api/bindActionCreators.md 3.92KB
  33. redux-3.0.3/docs/api/combineReducers.md 4.13KB
  34. redux-3.0.3/docs/api/compose.md 2.12KB
  35. redux-3.0.3/docs/api/createStore.md 2.83KB
  36. redux-3.0.3/docs/basics/
  37. redux-3.0.3/docs/basics/Actions.md 4.59KB
  38. redux-3.0.3/docs/basics/DataFlow.md 4.87KB
  39. redux-3.0.3/docs/basics/ExampleTodoList.md 6.5KB
  40. redux-3.0.3/docs/basics/README.md 500B
  41. redux-3.0.3/docs/basics/Reducers.md 13.91KB
  42. redux-3.0.3/docs/basics/Store.md 2.92KB
  43. redux-3.0.3/docs/basics/UsageWithReact.md 12.02KB
  44. redux-3.0.3/docs/introduction/
  45. redux-3.0.3/docs/introduction/Ecosystem.md 5.47KB
  46. redux-3.0.3/docs/introduction/Examples.md 2.7KB
  47. redux-3.0.3/docs/introduction/Motivation.md 2.18KB
  48. redux-3.0.3/docs/introduction/PriorArt.md 7.18KB
  49. redux-3.0.3/docs/introduction/README.md 169B
  50. redux-3.0.3/docs/introduction/ThreePrinciples.md 2.94KB
  51. redux-3.0.3/docs/recipes/
  52. redux-3.0.3/docs/recipes/ComputingDerivedData.md 6.49KB
  53. redux-3.0.3/docs/recipes/ImplementingUndoHistory.md 14.89KB
  54. redux-3.0.3/docs/recipes/MigratingToRedux.md 2.3KB
  55. redux-3.0.3/docs/recipes/README.md 499B
  56. redux-3.0.3/docs/recipes/ReducingBoilerplate.md 17.11KB
  57. redux-3.0.3/docs/recipes/ServerRendering.md 14.73KB
  58. redux-3.0.3/docs/recipes/WritingTests.md 13.84KB
  59. redux-3.0.3/examples/
  60. redux-3.0.3/examples/async/
  61. redux-3.0.3/examples/async/.babelrc 334B
  62. redux-3.0.3/examples/async/actions/
  63. redux-3.0.3/examples/async/actions/index.js 1.31KB
  64. redux-3.0.3/examples/async/components/
  65. redux-3.0.3/examples/async/components/Picker.js 672B
  66. redux-3.0.3/examples/async/components/Posts.js 317B
  67. redux-3.0.3/examples/async/containers/
  68. redux-3.0.3/examples/async/containers/App.js 2.56KB
  69. redux-3.0.3/examples/async/index.html 185B
  70. redux-3.0.3/examples/async/index.js 355B
  71. redux-3.0.3/examples/async/package.json 1.06KB
  72. redux-3.0.3/examples/async/reducers/
  73. redux-3.0.3/examples/async/reducers/index.js 1.22KB
  74. redux-3.0.3/examples/async/server.js 714B
  75. redux-3.0.3/examples/async/store/
  76. redux-3.0.3/examples/async/store/configureStore.js 661B
  77. redux-3.0.3/examples/async/webpack.config.js 1.13KB
  78. redux-3.0.3/examples/buildAll.js 1015B
  79. redux-3.0.3/examples/counter/
  80. redux-3.0.3/examples/counter/.babelrc 334B
  81. redux-3.0.3/examples/counter/actions/
  82. redux-3.0.3/examples/counter/actions/counter.js 599B
  83. redux-3.0.3/examples/counter/components/
  84. redux-3.0.3/examples/counter/components/Counter.js 822B
  85. redux-3.0.3/examples/counter/containers/
  86. redux-3.0.3/examples/counter/containers/App.js 431B
  87. redux-3.0.3/examples/counter/index.html 187B
  88. redux-3.0.3/examples/counter/index.js 325B
  89. redux-3.0.3/examples/counter/package.json 1.1KB
  90. redux-3.0.3/examples/counter/reducers/
  91. redux-3.0.3/examples/counter/reducers/counter.js 285B
  92. redux-3.0.3/examples/counter/reducers/index.js 156B
  93. redux-3.0.3/examples/counter/server.js 714B
  94. redux-3.0.3/examples/counter/store/
  95. redux-3.0.3/examples/counter/store/configureStore.js 566B
  96. redux-3.0.3/examples/counter/test/
  97. redux-3.0.3/examples/counter/test/actions/
  98. redux-3.0.3/examples/counter/test/actions/counter.spec.js 2.22KB
  99. redux-3.0.3/examples/counter/test/components/
  100. redux-3.0.3/examples/counter/test/components/Counter.spec.js 1.57KB
  101. redux-3.0.3/examples/counter/test/containers/
  102. redux-3.0.3/examples/counter/test/containers/App.spec.js 1.66KB
  103. redux-3.0.3/examples/counter/test/reducers/
  104. redux-3.0.3/examples/counter/test/reducers/counter.spec.js 683B
  105. redux-3.0.3/examples/counter/test/setup.js 184B
  106. redux-3.0.3/examples/counter/webpack.config.js 1.13KB
  107. redux-3.0.3/examples/real-world/
  108. redux-3.0.3/examples/real-world/.babelrc 334B
  109. redux-3.0.3/examples/real-world/actions/
  110. redux-3.0.3/examples/real-world/actions/index.js 3.93KB
  111. redux-3.0.3/examples/real-world/components/
  112. redux-3.0.3/examples/real-world/components/Explore.js 1.44KB
  113. redux-3.0.3/examples/real-world/components/List.js 1.25KB
  114. redux-3.0.3/examples/real-world/components/Repo.js 812B
  115. redux-3.0.3/examples/real-world/components/User.js 639B
  116. redux-3.0.3/examples/real-world/containers/
  117. redux-3.0.3/examples/real-world/containers/App.js 1.69KB
  118. redux-3.0.3/examples/real-world/containers/RepoPage.js 2.41KB
  119. redux-3.0.3/examples/real-world/containers/UserPage.js 2.41KB
  120. redux-3.0.3/examples/real-world/createDevToolsWindow.js 1.18KB
  121. redux-3.0.3/examples/real-world/index.html 190B
  122. redux-3.0.3/examples/real-world/index.js 675B
  123. redux-3.0.3/examples/real-world/middleware/
  124. redux-3.0.3/examples/real-world/middleware/api.js 3.44KB
  125. redux-3.0.3/examples/real-world/package.json 1.12KB
  126. redux-3.0.3/examples/real-world/reducers/
  127. redux-3.0.3/examples/real-world/reducers/index.js 1.37KB
  128. redux-3.0.3/examples/real-world/reducers/paginate.js 1.71KB
  129. redux-3.0.3/examples/real-world/routes.js 388B
  130. redux-3.0.3/examples/real-world/server.js 709B
  131. redux-3.0.3/examples/real-world/store/
  132. redux-3.0.3/examples/real-world/store/configureStore.js 947B
  133. redux-3.0.3/examples/real-world/webpack.config.js 1.13KB
  134. redux-3.0.3/examples/testAll.js 971B
  135. redux-3.0.3/examples/todomvc/
  136. redux-3.0.3/examples/todomvc/.babelrc 334B
  137. redux-3.0.3/examples/todomvc/actions/
  138. redux-3.0.3/examples/todomvc/actions/todos.js 527B
  139. redux-3.0.3/examples/todomvc/components/
  140. redux-3.0.3/examples/todomvc/components/Footer.js 1.79KB
  141. redux-3.0.3/examples/todomvc/components/Header.js 584B
  142. redux-3.0.3/examples/todomvc/components/MainSection.js 2.2KB
  143. redux-3.0.3/examples/todomvc/components/TodoItem.js 1.66KB
  144. redux-3.0.3/examples/todomvc/components/TodoTextInput.js 1.25KB
  145. redux-3.0.3/examples/todomvc/constants/
  146. redux-3.0.3/examples/todomvc/constants/ActionTypes.js 256B
  147. redux-3.0.3/examples/todomvc/constants/TodoFilters.js 126B
  148. redux-3.0.3/examples/todomvc/containers/
  149. redux-3.0.3/examples/todomvc/containers/App.js 881B
  150. redux-3.0.3/examples/todomvc/index.html 203B
  151. redux-3.0.3/examples/todomvc/index.js 391B
  152. redux-3.0.3/examples/todomvc/package.json 1.19KB
  153. redux-3.0.3/examples/todomvc/reducers/
  154. redux-3.0.3/examples/todomvc/reducers/index.js 150B
  155. redux-3.0.3/examples/todomvc/reducers/todos.js 1.14KB
  156. redux-3.0.3/examples/todomvc/server.js 714B
  157. redux-3.0.3/examples/todomvc/store/
  158. redux-3.0.3/examples/todomvc/store/configureStore.js 434B
  159. redux-3.0.3/examples/todomvc/test/
  160. redux-3.0.3/examples/todomvc/test/actions/
  161. redux-3.0.3/examples/todomvc/test/actions/todos.spec.js 1.18KB
  162. redux-3.0.3/examples/todomvc/test/components/
  163. redux-3.0.3/examples/todomvc/test/components/Footer.spec.js 3.3KB
  164. redux-3.0.3/examples/todomvc/test/components/Header.spec.js 1.36KB
  165. redux-3.0.3/examples/todomvc/test/components/MainSection.spec.js 4.33KB
  166. redux-3.0.3/examples/todomvc/test/components/TodoItem.spec.js 3.5KB
  167. redux-3.0.3/examples/todomvc/test/components/TodoTextInput.spec.js 2.57KB
  168. redux-3.0.3/examples/todomvc/test/reducers/
  169. redux-3.0.3/examples/todomvc/test/reducers/todos.spec.js 4.49KB
  170. redux-3.0.3/examples/todomvc/test/setup.js 184B
  171. redux-3.0.3/examples/todomvc/webpack.config.js 1.22KB
  172. redux-3.0.3/examples/todos-with-undo/
  173. redux-3.0.3/examples/todos-with-undo/.babelrc 334B
  174. redux-3.0.3/examples/todos-with-undo/actions.js 523B
  175. redux-3.0.3/examples/todos-with-undo/components/
  176. redux-3.0.3/examples/todos-with-undo/components/AddTodo.js 508B
  177. redux-3.0.3/examples/todos-with-undo/components/Footer.js 1.33KB
  178. redux-3.0.3/examples/todos-with-undo/components/Todo.js 527B
  179. redux-3.0.3/examples/todos-with-undo/components/TodoList.js 592B
  180. redux-3.0.3/examples/todos-with-undo/containers/
  181. redux-3.0.3/examples/todos-with-undo/containers/App.js 2.03KB
  182. redux-3.0.3/examples/todos-with-undo/index.html 195B
  183. redux-3.0.3/examples/todos-with-undo/index.js 380B
  184. redux-3.0.3/examples/todos-with-undo/package.json 937B
  185. redux-3.0.3/examples/todos-with-undo/reducers.js 936B
  186. redux-3.0.3/examples/todos-with-undo/server.js 714B
  187. redux-3.0.3/examples/todos-with-undo/webpack.config.js 1.13KB
  188. redux-3.0.3/examples/universal/
  189. redux-3.0.3/examples/universal/client/
  190. redux-3.0.3/examples/universal/client/index.js 461B
  191. redux-3.0.3/examples/universal/common/
  192. redux-3.0.3/examples/universal/common/actions/
  193. redux-3.0.3/examples/universal/common/actions/counter.js 731B
  194. redux-3.0.3/examples/universal/common/api/
  195. redux-3.0.3/examples/universal/common/api/counter.js 450B
  196. redux-3.0.3/examples/universal/common/components/
  197. redux-3.0.3/examples/universal/common/components/Counter.js 822B
  198. redux-3.0.3/examples/universal/common/containers/
  199. redux-3.0.3/examples/universal/common/containers/App.js 431B
  200. redux-3.0.3/examples/universal/common/reducers/
  201. redux-3.0.3/examples/universal/common/reducers/counter.js 345B
  202. redux-3.0.3/examples/universal/common/reducers/index.js 156B
  203. redux-3.0.3/examples/universal/common/store/
  204. redux-3.0.3/examples/universal/common/store/configureStore.js 582B
  205. redux-3.0.3/examples/universal/index.js 21B
  206. redux-3.0.3/examples/universal/package.json 986B
  207. redux-3.0.3/examples/universal/server/
  208. redux-3.0.3/examples/universal/server/index.js 48B
  209. redux-3.0.3/examples/universal/server/server.js 2.31KB
  210. redux-3.0.3/examples/universal/webpack.config.js 1.59KB
  211. redux-3.0.3/package.json 2.67KB
  212. redux-3.0.3/src/
  213. redux-3.0.3/src/createStore.js 5.12KB
  214. redux-3.0.3/src/index.js 349B
  215. redux-3.0.3/src/utils/
  216. redux-3.0.3/src/utils/applyMiddleware.js 1.19KB
  217. redux-3.0.3/src/utils/bindActionCreators.js 1.78KB
  218. redux-3.0.3/src/utils/combineReducers.js 4.87KB
  219. redux-3.0.3/src/utils/compose.js 397B
  220. redux-3.0.3/src/utils/isPlainObject.js 627B
  221. redux-3.0.3/src/utils/mapValues.js 443B
  222. redux-3.0.3/src/utils/pick.js 470B
  223. redux-3.0.3/test/
  224. redux-3.0.3/test/createStore.spec.js 8.06KB
  225. redux-3.0.3/test/helpers/
  226. redux-3.0.3/test/helpers/actionCreators.js 737B
  227. redux-3.0.3/test/helpers/actionTypes.js 182B
  228. redux-3.0.3/test/helpers/middleware.js 167B
  229. redux-3.0.3/test/helpers/reducers.js 971B
  230. redux-3.0.3/test/utils/
  231. redux-3.0.3/test/utils/applyMiddleware.spec.js 2.22KB
  232. redux-3.0.3/test/utils/bindActionCreators.spec.js 2.16KB
  233. redux-3.0.3/test/utils/combineReducers.spec.js 6.65KB
  234. redux-3.0.3/test/utils/compose.spec.js 799B
  235. redux-3.0.3/test/utils/isPlainObject.spec.js 728B
  236. redux-3.0.3/test/utils/mapValues.spec.js 331B
  237. redux-3.0.3/test/utils/pick.spec.js 322B
  238. redux-3.0.3/webpack.config.base.js 260B
  239. redux-3.0.3/webpack.config.development.js 328B
  240. redux-3.0.3/webpack.config.production.js 442B
0评论
提交 加载更多评论
其他资源 redux-3.1.1.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-3.1.3.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-3.1.4.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-3.1.2.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-3.1.0.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-3.0.6.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-3.0.5.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-3.0.4.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management