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

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

redux-3.0.2.zip

前端 175.22KB 1 需要积分: 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](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 project up and running, or aren’t sure where to paste the gist above, check out [simplest-redux-example](https://github.com/jackielii/simplest-redux-example) that uses R

资源文件列表:

redux-3.0.2.zip 大约有236个文件
  1. redux-3.0.2/
  2. redux-3.0.2/.babelrc 35B
  3. redux-3.0.2/.eslintignore 69B
  4. redux-3.0.2/.eslintrc 434B
  5. redux-3.0.2/.flowconfig 54B
  6. redux-3.0.2/.gitignore 53B
  7. redux-3.0.2/.npmignore 60B
  8. redux-3.0.2/.travis.yml 130B
  9. redux-3.0.2/CHANGELOG.md 222B
  10. redux-3.0.2/CODE_OF_CONDUCT.md 1.39KB
  11. redux-3.0.2/LICENSE.md 1.05KB
  12. redux-3.0.2/PATRONS.md 639B
  13. redux-3.0.2/README.md 9.68KB
  14. redux-3.0.2/book.json 259B
  15. redux-3.0.2/docs/
  16. redux-3.0.2/docs/Glossary.md 8.07KB
  17. redux-3.0.2/docs/README.md 1.69KB
  18. redux-3.0.2/docs/Troubleshooting.md 6.05KB
  19. redux-3.0.2/docs/advanced/
  20. redux-3.0.2/docs/advanced/AsyncActions.md 19.02KB
  21. redux-3.0.2/docs/advanced/AsyncFlow.md 1.44KB
  22. redux-3.0.2/docs/advanced/ExampleRedditAPI.md 7.55KB
  23. redux-3.0.2/docs/advanced/Middleware.md 16.43KB
  24. redux-3.0.2/docs/advanced/NextSteps.md 103B
  25. redux-3.0.2/docs/advanced/README.md 421B
  26. redux-3.0.2/docs/advanced/UsageWithReactRouter.md 116B
  27. redux-3.0.2/docs/api/
  28. redux-3.0.2/docs/api/README.md 1.25KB
  29. redux-3.0.2/docs/api/Store.md 7.06KB
  30. redux-3.0.2/docs/api/applyMiddleware.md 9.7KB
  31. redux-3.0.2/docs/api/bindActionCreators.md 3.92KB
  32. redux-3.0.2/docs/api/combineReducers.md 4.15KB
  33. redux-3.0.2/docs/api/compose.md 2.1KB
  34. redux-3.0.2/docs/api/createStore.md 2.83KB
  35. redux-3.0.2/docs/basics/
  36. redux-3.0.2/docs/basics/Actions.md 4.55KB
  37. redux-3.0.2/docs/basics/DataFlow.md 4.83KB
  38. redux-3.0.2/docs/basics/ExampleTodoList.md 6.59KB
  39. redux-3.0.2/docs/basics/README.md 500B
  40. redux-3.0.2/docs/basics/Reducers.md 13.91KB
  41. redux-3.0.2/docs/basics/Store.md 2.92KB
  42. redux-3.0.2/docs/basics/UsageWithReact.md 12.18KB
  43. redux-3.0.2/docs/introduction/
  44. redux-3.0.2/docs/introduction/Ecosystem.md 3.66KB
  45. redux-3.0.2/docs/introduction/Examples.md 2.7KB
  46. redux-3.0.2/docs/introduction/Motivation.md 2.19KB
  47. redux-3.0.2/docs/introduction/PriorArt.md 7.18KB
  48. redux-3.0.2/docs/introduction/README.md 169B
  49. redux-3.0.2/docs/introduction/ThreePrinciples.md 2.94KB
  50. redux-3.0.2/docs/recipes/
  51. redux-3.0.2/docs/recipes/ComputingDerivedData.md 6.49KB
  52. redux-3.0.2/docs/recipes/MigratingToRedux.md 2.3KB
  53. redux-3.0.2/docs/recipes/README.md 440B
  54. redux-3.0.2/docs/recipes/ReducingBoilerplate.md 17.11KB
  55. redux-3.0.2/docs/recipes/ServerRendering.md 14.57KB
  56. redux-3.0.2/docs/recipes/WritingTests.md 10.85KB
  57. redux-3.0.2/examples/
  58. redux-3.0.2/examples/async/
  59. redux-3.0.2/examples/async/.babelrc 288B
  60. redux-3.0.2/examples/async/actions/
  61. redux-3.0.2/examples/async/actions/index.js 1.31KB
  62. redux-3.0.2/examples/async/components/
  63. redux-3.0.2/examples/async/components/Picker.js 672B
  64. redux-3.0.2/examples/async/components/Posts.js 317B
  65. redux-3.0.2/examples/async/containers/
  66. redux-3.0.2/examples/async/containers/App.js 2.56KB
  67. redux-3.0.2/examples/async/index.html 185B
  68. redux-3.0.2/examples/async/index.js 333B
  69. redux-3.0.2/examples/async/package.json 1.11KB
  70. redux-3.0.2/examples/async/reducers/
  71. redux-3.0.2/examples/async/reducers/index.js 1.22KB
  72. redux-3.0.2/examples/async/server.js 714B
  73. redux-3.0.2/examples/async/store/
  74. redux-3.0.2/examples/async/store/configureStore.js 667B
  75. redux-3.0.2/examples/async/webpack.config.js 1.13KB
  76. redux-3.0.2/examples/buildAll.js 1015B
  77. redux-3.0.2/examples/counter/
  78. redux-3.0.2/examples/counter/.babelrc 288B
  79. redux-3.0.2/examples/counter/actions/
  80. redux-3.0.2/examples/counter/actions/counter.js 599B
  81. redux-3.0.2/examples/counter/components/
  82. redux-3.0.2/examples/counter/components/Counter.js 822B
  83. redux-3.0.2/examples/counter/containers/
  84. redux-3.0.2/examples/counter/containers/App.js 431B
  85. redux-3.0.2/examples/counter/index.html 187B
  86. redux-3.0.2/examples/counter/index.js 303B
  87. redux-3.0.2/examples/counter/package.json 1.04KB
  88. redux-3.0.2/examples/counter/reducers/
  89. redux-3.0.2/examples/counter/reducers/counter.js 285B
  90. redux-3.0.2/examples/counter/reducers/index.js 156B
  91. redux-3.0.2/examples/counter/server.js 714B
  92. redux-3.0.2/examples/counter/store/
  93. redux-3.0.2/examples/counter/store/configureStore.js 566B
  94. redux-3.0.2/examples/counter/test/
  95. redux-3.0.2/examples/counter/test/actions/
  96. redux-3.0.2/examples/counter/test/actions/counter.spec.js 1.35KB
  97. redux-3.0.2/examples/counter/test/components/
  98. redux-3.0.2/examples/counter/test/components/Counter.spec.js 1.68KB
  99. redux-3.0.2/examples/counter/test/containers/
  100. redux-3.0.2/examples/counter/test/containers/App.spec.js 1.78KB
  101. redux-3.0.2/examples/counter/test/jsdomReact.js 194B
  102. redux-3.0.2/examples/counter/test/reducers/
  103. redux-3.0.2/examples/counter/test/reducers/counter.spec.js 683B
  104. redux-3.0.2/examples/counter/webpack.config.js 1.13KB
  105. redux-3.0.2/examples/real-world/
  106. redux-3.0.2/examples/real-world/.babelrc 288B
  107. redux-3.0.2/examples/real-world/actions/
  108. redux-3.0.2/examples/real-world/actions/index.js 3.93KB
  109. redux-3.0.2/examples/real-world/components/
  110. redux-3.0.2/examples/real-world/components/Explore.js 1.48KB
  111. redux-3.0.2/examples/real-world/components/List.js 1.25KB
  112. redux-3.0.2/examples/real-world/components/Repo.js 812B
  113. redux-3.0.2/examples/real-world/components/User.js 639B
  114. redux-3.0.2/examples/real-world/containers/
  115. redux-3.0.2/examples/real-world/containers/App.js 1.87KB
  116. redux-3.0.2/examples/real-world/containers/RepoPage.js 2.43KB
  117. redux-3.0.2/examples/real-world/containers/UserPage.js 2.42KB
  118. redux-3.0.2/examples/real-world/index.html 190B
  119. redux-3.0.2/examples/real-world/index.js 836B
  120. redux-3.0.2/examples/real-world/middleware/
  121. redux-3.0.2/examples/real-world/middleware/api.js 3.44KB
  122. redux-3.0.2/examples/real-world/package.json 1.01KB
  123. redux-3.0.2/examples/real-world/reducers/
  124. redux-3.0.2/examples/real-world/reducers/index.js 1.3KB
  125. redux-3.0.2/examples/real-world/reducers/paginate.js 1.71KB
  126. redux-3.0.2/examples/real-world/server.js 714B
  127. redux-3.0.2/examples/real-world/store/
  128. redux-3.0.2/examples/real-world/store/configureStore.js 731B
  129. redux-3.0.2/examples/real-world/webpack.config.js 1.13KB
  130. redux-3.0.2/examples/testAll.js 971B
  131. redux-3.0.2/examples/todomvc/
  132. redux-3.0.2/examples/todomvc/.babelrc 288B
  133. redux-3.0.2/examples/todomvc/actions/
  134. redux-3.0.2/examples/todomvc/actions/todos.js 527B
  135. redux-3.0.2/examples/todomvc/components/
  136. redux-3.0.2/examples/todomvc/components/Footer.js 1.79KB
  137. redux-3.0.2/examples/todomvc/components/Header.js 584B
  138. redux-3.0.2/examples/todomvc/components/MainSection.js 2.2KB
  139. redux-3.0.2/examples/todomvc/components/TodoItem.js 1.66KB
  140. redux-3.0.2/examples/todomvc/components/TodoTextInput.js 1.25KB
  141. redux-3.0.2/examples/todomvc/constants/
  142. redux-3.0.2/examples/todomvc/constants/ActionTypes.js 256B
  143. redux-3.0.2/examples/todomvc/constants/TodoFilters.js 126B
  144. redux-3.0.2/examples/todomvc/containers/
  145. redux-3.0.2/examples/todomvc/containers/App.js 805B
  146. redux-3.0.2/examples/todomvc/index.html 203B
  147. redux-3.0.2/examples/todomvc/index.js 370B
  148. redux-3.0.2/examples/todomvc/package.json 1.13KB
  149. redux-3.0.2/examples/todomvc/reducers/
  150. redux-3.0.2/examples/todomvc/reducers/index.js 150B
  151. redux-3.0.2/examples/todomvc/reducers/todos.js 1.14KB
  152. redux-3.0.2/examples/todomvc/server.js 714B
  153. redux-3.0.2/examples/todomvc/store/
  154. redux-3.0.2/examples/todomvc/store/configureStore.js 434B
  155. redux-3.0.2/examples/todomvc/test/
  156. redux-3.0.2/examples/todomvc/test/actions/
  157. redux-3.0.2/examples/todomvc/test/actions/todos.spec.js 1.18KB
  158. redux-3.0.2/examples/todomvc/test/components/
  159. redux-3.0.2/examples/todomvc/test/components/Footer.spec.js 3.35KB
  160. redux-3.0.2/examples/todomvc/test/components/Header.spec.js 1.41KB
  161. redux-3.0.2/examples/todomvc/test/components/MainSection.spec.js 4.38KB
  162. redux-3.0.2/examples/todomvc/test/components/TodoItem.spec.js 3.55KB
  163. redux-3.0.2/examples/todomvc/test/components/TodoTextItem.spec.js 2.62KB
  164. redux-3.0.2/examples/todomvc/test/jsdomReact.js 194B
  165. redux-3.0.2/examples/todomvc/test/reducers/
  166. redux-3.0.2/examples/todomvc/test/reducers/todos.spec.js 4.49KB
  167. redux-3.0.2/examples/todomvc/webpack.config.js 1.22KB
  168. redux-3.0.2/examples/todos-with-undo/
  169. redux-3.0.2/examples/todos-with-undo/.babelrc 288B
  170. redux-3.0.2/examples/todos-with-undo/actions.js 601B
  171. redux-3.0.2/examples/todos-with-undo/components/
  172. redux-3.0.2/examples/todos-with-undo/components/AddTodo.js 534B
  173. redux-3.0.2/examples/todos-with-undo/components/Footer.js 1.33KB
  174. redux-3.0.2/examples/todos-with-undo/components/Todo.js 527B
  175. redux-3.0.2/examples/todos-with-undo/components/TodoList.js 592B
  176. redux-3.0.2/examples/todos-with-undo/containers/
  177. redux-3.0.2/examples/todos-with-undo/containers/App.js 2.47KB
  178. redux-3.0.2/examples/todos-with-undo/index.html 195B
  179. redux-3.0.2/examples/todos-with-undo/index.js 447B
  180. redux-3.0.2/examples/todos-with-undo/package.json 984B
  181. redux-3.0.2/examples/todos-with-undo/reducers.js 992B
  182. redux-3.0.2/examples/todos-with-undo/server.js 714B
  183. redux-3.0.2/examples/todos-with-undo/webpack.config.js 1.13KB
  184. redux-3.0.2/examples/universal/
  185. redux-3.0.2/examples/universal/client/
  186. redux-3.0.2/examples/universal/client/index.js 443B
  187. redux-3.0.2/examples/universal/common/
  188. redux-3.0.2/examples/universal/common/actions/
  189. redux-3.0.2/examples/universal/common/actions/counter.js 731B
  190. redux-3.0.2/examples/universal/common/api/
  191. redux-3.0.2/examples/universal/common/api/counter.js 450B
  192. redux-3.0.2/examples/universal/common/components/
  193. redux-3.0.2/examples/universal/common/components/Counter.js 822B
  194. redux-3.0.2/examples/universal/common/containers/
  195. redux-3.0.2/examples/universal/common/containers/App.js 431B
  196. redux-3.0.2/examples/universal/common/reducers/
  197. redux-3.0.2/examples/universal/common/reducers/counter.js 345B
  198. redux-3.0.2/examples/universal/common/reducers/index.js 156B
  199. redux-3.0.2/examples/universal/common/store/
  200. redux-3.0.2/examples/universal/common/store/configureStore.js 582B
  201. redux-3.0.2/examples/universal/index.js 21B
  202. redux-3.0.2/examples/universal/package.json 958B
  203. redux-3.0.2/examples/universal/server/
  204. redux-3.0.2/examples/universal/server/index.js 48B
  205. redux-3.0.2/examples/universal/server/server.js 2.27KB
  206. redux-3.0.2/examples/universal/webpack.config.js 1.53KB
  207. redux-3.0.2/package.json 2.62KB
  208. redux-3.0.2/src/
  209. redux-3.0.2/src/createStore.js 5.12KB
  210. redux-3.0.2/src/index.js 349B
  211. redux-3.0.2/src/utils/
  212. redux-3.0.2/src/utils/applyMiddleware.js 1.19KB
  213. redux-3.0.2/src/utils/bindActionCreators.js 1.78KB
  214. redux-3.0.2/src/utils/combineReducers.js 4.68KB
  215. redux-3.0.2/src/utils/compose.js 397B
  216. redux-3.0.2/src/utils/isPlainObject.js 627B
  217. redux-3.0.2/src/utils/mapValues.js 443B
  218. redux-3.0.2/src/utils/pick.js 470B
  219. redux-3.0.2/test/
  220. redux-3.0.2/test/createStore.spec.js 8.06KB
  221. redux-3.0.2/test/helpers/
  222. redux-3.0.2/test/helpers/actionCreators.js 737B
  223. redux-3.0.2/test/helpers/actionTypes.js 182B
  224. redux-3.0.2/test/helpers/middleware.js 167B
  225. redux-3.0.2/test/helpers/reducers.js 971B
  226. redux-3.0.2/test/utils/
  227. redux-3.0.2/test/utils/applyMiddleware.spec.js 2.22KB
  228. redux-3.0.2/test/utils/bindActionCreators.spec.js 2.16KB
  229. redux-3.0.2/test/utils/combineReducers.spec.js 5.56KB
  230. redux-3.0.2/test/utils/compose.spec.js 799B
  231. redux-3.0.2/test/utils/isPlainObject.spec.js 728B
  232. redux-3.0.2/test/utils/mapValues.spec.js 331B
  233. redux-3.0.2/test/utils/pick.spec.js 322B
  234. redux-3.0.2/webpack.config.base.js 295B
  235. redux-3.0.2/webpack.config.development.js 328B
  236. redux-3.0.2/webpack.config.production.js 442B
0评论
提交 加载更多评论
其他资源 redux-3.0.4.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.6.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.0.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-2.1.1.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management
redux-1.0.1.zip
一个可预测的全局状态管理的 JS 库 A JS library for predictable global state management