[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-500":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},500,"redux","reduxjs\u002Fredux","reduxjs","A JS library for predictable global state management","https:\u002F\u002Fredux.js.org",null,"TypeScript",61469,15057,1274,42,0,39,52,3,45,"MIT License",false,"master",true,[5],"2026-06-12 02:00:14","# \u003Ca href='https:\u002F\u002Fredux.js.org'>\u003Cimg src='https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F13142323?s=200&v=4' height='60' alt='Redux Logo' aria-label='redux.js.org' style=\"display: flex;align-items: center;\"\u002F>Redux\u003C\u002Fa>\n\nRedux is a JS library for predictable and maintainable global state management.\n\nIt 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:\u002F\u002Fgithub.com\u002Freduxjs\u002Fredux-devtools).\n\nYou can use Redux together with [React](https:\u002F\u002Freact.dev), or with any other view library. The Redux core is tiny (2kB, including dependencies), and has a rich ecosystem of addons.\n\n[**Redux Toolkit**](https:\u002F\u002Fredux-toolkit.js.org) is our official recommended approach for writing Redux logic. It wraps around the Redux core, and contains packages and functions that we think are essential for building a Redux app. Redux Toolkit builds in our suggested best practices, simplifies most Redux tasks, prevents common mistakes, and makes it easier to write Redux applications.\n\n![GitHub Workflow Status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Freduxjs\u002Fredux\u002Ftest.yaml?branch=master&event=push&style=flat-square)\n[![npm version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fredux.svg?style=flat-square)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fredux)\n[![npm downloads](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Fredux.svg?style=flat-square)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fredux)\n[![redux channel on discord](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdiscord-%23redux%20%40%20reactiflux-61dafb.svg?style=flat-square)](https:\u002F\u002Fdiscord.gg\u002F0ZcbPKXt5bZ6au5t)\n\n## Installation\n\n### Create a React Redux App\n\nThe recommended way to start new apps with React and Redux Toolkit is by using [our official Redux Toolkit + TS template for Vite](https:\u002F\u002Fgithub.com\u002Freduxjs\u002Fredux-templates), or by creating a new Next.js project using [Next's `with-redux` template](https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js\u002Ftree\u002Fcanary\u002Fexamples\u002Fwith-redux).\n\nBoth of these already have Redux Toolkit and React-Redux configured appropriately for that build tool, and come with a small example app that demonstrates how to use several of Redux Toolkit's features.\n\n```bash\n# Vite with our Redux+TS template\n# (using the `degit` tool to clone and extract the template)\nnpx degit reduxjs\u002Fredux-templates\u002Fpackages\u002Fvite-template-redux my-app\n\n# Next.js using the `with-redux` template\nnpx create-next-app --example with-redux my-app\n```\n\nWe do not currently have official React Native templates, but recommend these templates for standard React Native and for Expo:\n\n- https:\u002F\u002Fgithub.com\u002Frahsheen\u002Freact-native-template-redux-typescript\n- https:\u002F\u002Fgithub.com\u002Frahsheen\u002Fexpo-template-redux-typescript\n\n```\nnpm install @reduxjs\u002Ftoolkit react-redux\n```\n\nFor the Redux core library by itself:\n\n```\nnpm install redux\n```\n\nFor more details, see [the Installation docs page](https:\u002F\u002Fredux.js.org\u002Fintroduction\u002Finstallation).\n\n## Documentation\n\nThe Redux core docs are located at **https:\u002F\u002Fredux.js.org**, and include the full Redux tutorials, as well usage guides on general Redux patterns:\n\n- [Introduction](https:\u002F\u002Fredux.js.org\u002Fintroduction\u002Fgetting-started)\n- [Tutorials](https:\u002F\u002Fredux.js.org\u002Ftutorials\u002Findex)\n- [Usage Guides](https:\u002F\u002Fredux.js.org\u002Fusage\u002Findex)\n- [FAQ](https:\u002F\u002Fredux.js.org\u002Ffaq)\n- [API Reference](https:\u002F\u002Fredux.js.org\u002Fapi\u002Fapi-reference)\n\nThe Redux Toolkit docs are available at **https:\u002F\u002Fredux-toolkit.js.org**, including API references and usage guides for all of the APIs included in Redux Toolkit.\n\n## Learn Redux\n\n### Redux Essentials Tutorial\n\nThe [**Redux Essentials tutorial**](https:\u002F\u002Fredux.js.org\u002Ftutorials\u002Fessentials\u002Fpart-1-overview-concepts) is a \"top-down\" tutorial that teaches \"how to use Redux the right way\", using our latest recommended APIs and best practices. We recommend starting there.\n\n### Redux Fundamentals Tutorial\n\nThe [**Redux Fundamentals tutorial**](https:\u002F\u002Fredux.js.org\u002Ftutorials\u002Ffundamentals\u002Fpart-1-overview) is a \"bottom-up\" tutorial that teaches \"how Redux works\" from first principles and without any abstractions, and why standard Redux usage patterns exist.\n\n### Help and Discussion\n\nThe **[#redux channel](https:\u002F\u002Fdiscord.gg\u002F0ZcbPKXt5bZ6au5t)** of the **[Reactiflux Discord community](https:\u002F\u002Fwww.reactiflux.com)** is our official resource for all questions related to learning and using Redux. Reactiflux is a great place to hang out, ask questions, and learn - please come and join us there!\n\n## Before Proceeding Further\n\nRedux is a valuable tool for organizing your state, but you should also consider whether it's appropriate for your situation. Please don't use Redux just because someone said you should - instead, please take some time to understand the potential benefits and tradeoffs of using it.\n\nHere are some suggestions on when it makes sense to use Redux:\n\n- You have reasonable amounts of data changing over time\n- You need a single source of truth for your state\n- You find that keeping all your state in a top-level component is no longer sufficient\n\nYes, these guidelines are subjective and vague, but this is for a good reason. The point at which you should integrate Redux into your application is different for every user and different for every application.\n\n> **For more thoughts on how Redux is meant to be used, please see:**\u003Cbr>\n>\n> - **[When (and when not) to reach for Redux](https:\u002F\u002Fchangelog.com\u002Fposts\u002Fwhen-and-when-not-to-reach-for-redux)**\n> - **[You Might Not Need Redux](https:\u002F\u002Fmedium.com\u002F@dan_abramov\u002Fyou-might-not-need-redux-be46360cf367)**\u003Cbr>\n> - **[The Tao of Redux, Part 1 - Implementation and Intent](https:\u002F\u002Fblog.isquaredsoftware.com\u002F2017\u002F05\u002Fidiomatic-redux-tao-of-redux-part-1\u002F)**\u003Cbr>\n> - **[The Tao of Redux, Part 2 - Practice and Philosophy](https:\u002F\u002Fblog.isquaredsoftware.com\u002F2017\u002F05\u002Fidiomatic-redux-tao-of-redux-part-2\u002F)**\n> - **[Redux FAQ](https:\u002F\u002Fredux.js.org\u002Ffaq)**\n\n## Basic Example\n\nThe whole global state of your app is stored in an object tree inside a single _store_.\nThe only way to change the state tree is to create an _action_, an object describing what happened, and _dispatch_ it to the store.\nTo specify how state gets updated in response to an action, you write pure _reducer_ functions that calculate a new state based on the old state and the action.\n\nRedux Toolkit simplifies the process of writing Redux logic and setting up the store. With Redux Toolkit, the basic app logic looks like:\n\n```js\nimport { createSlice, configureStore } from '@reduxjs\u002Ftoolkit'\n\nconst counterSlice = createSlice({\n  name: 'counter',\n  initialState: {\n    value: 0\n  },\n  reducers: {\n    incremented: state => {\n      \u002F\u002F Redux Toolkit allows us to write \"mutating\" logic in reducers. It\n      \u002F\u002F doesn't actually mutate the state because it uses the Immer library,\n      \u002F\u002F which detects changes to a \"draft state\" and produces a brand new\n      \u002F\u002F immutable state based off those changes\n      state.value += 1\n    },\n    decremented: state => {\n      state.value -= 1\n    }\n  }\n})\n\nexport const { incremented, decremented } = counterSlice.actions\n\nconst store = configureStore({\n  reducer: counterSlice.reducer\n})\n\n\u002F\u002F Can still subscribe to the store\nstore.subscribe(() => console.log(store.getState()))\n\n\u002F\u002F Still pass action objects to `dispatch`, but they're created for us\nstore.dispatch(incremented())\n\u002F\u002F {value: 1}\nstore.dispatch(incremented())\n\u002F\u002F {value: 2}\nstore.dispatch(decremented())\n\u002F\u002F {value: 1}\n```\n\nRedux Toolkit allows us to write shorter logic that's easier to read, while still following the original core Redux behavior and data flow.\n\n## Logo\n\nYou can find the official logo [on GitHub](https:\u002F\u002Fgithub.com\u002Freduxjs\u002Fredux\u002Ftree\u002Fmaster\u002Flogo).\n\n## Change Log\n\nThis project adheres to [Semantic Versioning](https:\u002F\u002Fsemver.org\u002F).\nEvery release, along with the migration instructions, is documented on the GitHub [Releases](https:\u002F\u002Fgithub.com\u002Freduxjs\u002Fredux\u002Freleases) page.\n\n## License\n\n[MIT](LICENSE.md)\n","Redux 是一个用于可预测和可维护的全局状态管理的 JavaScript 库。其核心功能包括提供一致的应用行为、支持多环境运行（客户端、服务器端及原生应用）以及易于测试。此外，它还提供了诸如实时代码编辑结合时间旅行调试器等优秀的开发者体验工具。Redux 可以与 React 或其他视图库一起使用，且其核心体积非常小（2kB，含依赖）。官方推荐使用 Redux Toolkit 来编写 Redux 逻辑，该工具集成了最佳实践，简化了大多数 Redux 操作，并防止常见错误的发生。适用于需要统一管理和追踪应用状态的各种前端项目，尤其是那些追求高效开发流程和良好用户体验的复杂应用。",2,"2026-06-11 02:36:36","top_all"]