{"bugs":{"url":"https://github.com/reduxjs/redux/issues"},"dist":{"shasum":"84b2c39ac30548fa8061d6383b3c2fac65f0bdc2","tarball":"https://registry.npmjs.org/redux/-/redux-5.0.0-alpha.1.tgz","fileCount":38,"integrity":"sha512-uhaB2F5QRTv0YtKGtFDe7wjQjhBCP2TI4tpjW/O+iChhrtRh603GVzcgkAVFvRRRp3L9wcfhlSnEnqgKz5ABaQ==","signatures":[{"sig":"MEUCIGHuc/4+2I64fV0K20AqiHDWavhV5gVqscMd0ZKa8mD5AiEA4yCkK1RCrTaGXg/gc/US6JBO2mKkzg8SiK6GUJTOJCU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1bmBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPTQ/5ADbaXS6vHqAnUHWEeYuVIaqee4MXucU9VlvBcLnnZnZBnH0i\r\n8FbkbuVEm7YhVT/9pZZPoblBuScILrO0nYSo59dhjGopmDIkSL1Eni50FMyd\r\nP/mqIPpdoTf3FN9kLod3ZgTSWO96E4vfNjC+n+UmAXa1lCoPlUjbmJ+9HYlH\r\n2+5VVsIMYi+7Nc2LwzfIGuI3vHmtFn/EM6mT4hXstaB6gAtbezUPGUuGyFZf\r\nj4mz4Tq5HWQe9PTVVXl/CK7UXCfbGcJDDgzOt77JKIf/efs2c8o7TvmDE1ib\r\nBHV+URMIZbynftMABTmsJWmPvlSwuaU9moNPJraGiabA0mURnPFPlKL+yQfE\r\nUuEylxZT5gLOgI4XpLnerrvrST1KTuOfpsDMpuqlSpkQ/RBn6RguZCgT7q+a\r\nORPYOVA8jlSJFY9r1OV2relw7BBknH97fWbJCKtO659qHf5RqRvzUrZCVtkg\r\nZ7d1u03OsijivOfzrFBwEsfPZ0lCpvBGsJx55/1ekFpXjcCQI3gqACfGCPcI\r\n0F60654l93wZD7tlQoSui9ExfsqRawI32hDYd35KxDGzqvmYlZyKrEStuNOo\r\nb+GCmOsEnUEsfN8776Hu0SVJMBK70NfyLnS9gZSLh1vlYzo6wyZDZsPn2nEM\r\nUJQvB8esqEcn/Um+O61cq1DcE5F+3UTzKfQ=\r\n=MTaj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.cjs","name":"redux","type":"module","types":"types/index.d.ts","module":"dist/es/index.js","readme":"# <a href='https://redux.js.org'><img src='https://camo.githubusercontent.com/f28b5bc7822f1b7bb28a96d8d09e7d79169248fc/687474703a2f2f692e696d6775722e636f6d2f4a65567164514d2e706e67' height='60' alt='Redux Logo' aria-label='redux.js.org' /></a>\n\nRedux is a predictable state container for JavaScript apps.\n(Not to be confused with a WordPress framework – [Redux Framework](https://redux.io))\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://github.com/reduxjs/redux-devtools).\n\nYou can use Redux together with [React](https://reactjs.org), or with any other view library.\nIt is tiny (2kB, including dependencies), and has a rich ecosystem of addons.\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/reduxjs/redux/Tests/master?style=flat-square)\n[![npm version](https://img.shields.io/npm/v/redux.svg?style=flat-square)](https://www.npmjs.com/package/redux)\n[![npm downloads](https://img.shields.io/npm/dm/redux.svg?style=flat-square)](https://www.npmjs.com/package/redux)\n[![redux channel on discord](https://img.shields.io/badge/discord-%23redux%20%40%20reactiflux-61dafb.svg?style=flat-square)](https://discord.gg/0ZcbPKXt5bZ6au5t)\n[![Changelog #187](https://img.shields.io/badge/changelog-%23187-lightgrey.svg?style=flat-square)](https://changelog.com/187)\n\n## Installation\n\n[**Redux Toolkit**](https://redux-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```\nnpm install @reduxjs/toolkit 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://redux.js.org/introduction/installation).\n\n## Documentation\n\nThe Redux docs are located at **https://redux.js.org**:\n\n- [Introduction](https://redux.js.org/introduction/getting-started)\n- [Tutorials](https://redux.js.org/tutorials/index)\n- [Usage Guides](https://redux.js.org/usage/index)\n- [FAQ](https://redux.js.org/faq)\n- [API Reference](https://redux.js.org/api/api-reference)\n\n## Learn Redux\n\n### Redux Essentials Tutorial\n\nThe [**Redux Essentials tutorial**](https://redux.js.org/tutorials/essentials/part-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://redux.js.org/tutorials/fundamentals/part-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### Additional Tutorials\n\n- The Redux repository contains several example projects demonstrating various aspects of how to use Redux. Almost all examples have a corresponding CodeSandbox sandbox. This is an interactive version of the code that you can play with online. See the complete list of examples in the **[Examples page](https://redux.js.org/introduction/examples)**.\n- Redux creator Dan Abramov's **free [\"Getting Started with Redux\" video series](https://app.egghead.io/playlists/fundamentals-of-redux-course-from-dan-abramov-bd5cc867)** and **[Building React Applications with Idiomatic Redux](https://egghead.io/courses/building-react-applications-with-idiomatic-redux)** video courses on Egghead.io\n- Redux maintainer Mark Erikson's **[\"Redux Fundamentals\" conference talk](https://blog.isquaredsoftware.com/2018/03/presentation-reactathon-redux-fundamentals/)** and [**\"Redux Fundamentals\" workshop slides**](https://blog.isquaredsoftware.com/2018/06/redux-fundamentals-workshop-slides/)\n- Dave Ceddia's post [**A Complete React Redux Tutorial for Beginners**](https://daveceddia.com/redux-tutorial/)\n\n### Other Resources\n\n- The **[Redux FAQ](https://redux.js.org/faq)** answers many common questions about how to use Redux, and the **[\"Using Redux\" docs section](https://redux.js.org/usage/index)** has information on handling derived data, testing, structuring reducer logic, and reducing boilerplate.\n- Redux maintainer Mark Erikson's **[\"Practical Redux\" tutorial series](https://blog.isquaredsoftware.com/series/practical-redux/)** demonstrates real-world intermediate and advanced techniques for working with React and Redux (also available as **[an interactive course on Educative.io](https://www.educative.io/collection/5687753853370368/5707702298738688)**).\n- The **[React/Redux links list](https://github.com/markerikson/react-redux-links)** has categorized articles on working with [reducers and selectors](https://github.com/markerikson/react-redux-links/blob/master/redux-reducers-selectors.md), [managing side effects](https://github.com/markerikson/react-redux-links/blob/master/redux-side-effects.md), [Redux architecture and best practices](https://github.com/markerikson/react-redux-links/blob/master/redux-architecture.md), and more.\n- Our community has created thousands of Redux-related libraries, addons, and tools. The **[\"Ecosystem\" docs page](https://redux.js.org/introduction/ecosystem)** lists our recommendations, and also there's a complete listing available in the **[Redux addons catalog](https://github.com/markerikson/redux-ecosystem-links)**.\n\n### Help and Discussion\n\nThe **[#redux channel](https://discord.gg/0ZcbPKXt5bZ6au5t)** of the **[Reactiflux Discord community](https://www.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:**<br>\n>\n> - **[When (and when not) to reach for Redux](https://changelog.com/posts/when-and-when-not-to-reach-for-redux)**\n> - **[You Might Not Need Redux](https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367)**<br>\n> - **[The Tao of Redux, Part 1 - Implementation and Intent](https://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao-of-redux-part-1/)**<br>\n> - **[The Tao of Redux, Part 2 - Practice and Philosophy](https://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao-of-redux-part-2/)**\n> - **[Redux FAQ](https://redux.js.org/faq)**\n\n## Developer Experience\n\nDan Abramov (author of Redux) wrote Redux while working on his React Europe talk called [“Hot Reloading with Time Travel”](https://www.youtube.com/watch?v=xsSnOQynTHs). His goal was to create a state management library with a minimal API but completely predictable behavior. Redux makes it possible to implement logging, hot reloading, time travel, universal apps, record and replay, without any buy-in from the developer.\n\n## Influences\n\nRedux 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/).\nEven if you haven't used Flux or Elm, Redux only takes a few minutes to get started with.\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\n```js\nimport { createStore } from 'redux'\n\n/**\n * This is a reducer - a function that takes a current state value and an\n * action object describing \"what happened\", and returns a new state value.\n * A reducer's function signature is: (state, action) => newState\n *\n * The Redux state should contain only plain JS objects, arrays, and primitives.\n * The root state value is usually an object.  It's important that you should\n * not mutate the state object, but return a new object if the state changes.\n *\n * You can use any conditional logic you want in a reducer. In this example,\n * we use a switch statement, but it's not required.\n */\nfunction counterReducer(state = { value: 0 }, action) {\n  switch (action.type) {\n    case 'counter/incremented':\n      return { value: state.value + 1 }\n    case 'counter/decremented':\n      return { value: state.value - 1 }\n    default:\n      return state\n  }\n}\n\n// Create a Redux store holding the state of your app.\n// Its API is { subscribe, dispatch, getState }.\nlet store = createStore(counterReducer)\n\n// You can use subscribe() to update the UI in response to state changes.\n// Normally you'd use a view binding library (e.g. React Redux) rather than subscribe() directly.\n// There may be additional use cases where it's helpful to subscribe as well.\n\nstore.subscribe(() => console.log(store.getState()))\n\n// The only way to mutate the internal state is to dispatch an action.\n// The actions can be serialized, logged or stored and later replayed.\nstore.dispatch({ type: 'counter/incremented' })\n// {value: 1}\nstore.dispatch({ type: 'counter/incremented' })\n// {value: 2}\nstore.dispatch({ type: 'counter/decremented' })\n// {value: 1}\n```\n\nInstead 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.\n\nIn a typical Redux app, there is just a single store with a single root reducing function. As your app grows, you split the root reducer into smaller reducers independently operating on the different parts of the state tree. This is exactly like how there is just one root component in a React app, but it is composed out of many small components.\n\nThis architecture might seem like a lot 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.\n\n### Redux Toolkit Example\n\nRedux Toolkit simplifies the process of writing Redux logic and setting up the store. With Redux Toolkit, that same logic looks like:\n\n```js\nimport { createSlice, configureStore } from '@reduxjs/toolkit'\n\nconst counterSlice = createSlice({\n  name: 'counter',\n  initialState: {\n    value: 0\n  },\n  reducers: {\n    incremented: state => {\n      // Redux Toolkit allows us to write \"mutating\" logic in reducers. It\n      // doesn't actually mutate the state because it uses the Immer library,\n      // which detects changes to a \"draft state\" and produces a brand new\n      // 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// Can still subscribe to the store\nstore.subscribe(() => console.log(store.getState()))\n\n// Still pass action objects to `dispatch`, but they're created for us\nstore.dispatch(incremented())\n// {value: 1}\nstore.dispatch(incremented())\n// {value: 2}\nstore.dispatch(decremented())\n// {value: 1}\n```\n\nRedux Toolkit allows us to write shorter logic that's easier to read, while still following the same Redux behavior and data flow.\n\n## Examples\n\nAlmost all examples have a corresponding CodeSandbox sandbox. This is an interactive version of the code that you can play with online.\n\n- [**Counter Vanilla**](https://redux.js.org/introduction/examples#counter-vanilla): [Source](https://github.com/reduxjs/redux/tree/master/examples/counter-vanilla)\n- [**Counter**](https://redux.js.org/introduction/examples#counter): [Source](https://github.com/reduxjs/redux/tree/master/examples/counter) | [Sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/master/examples/counter)\n- [**Todos**](https://redux.js.org/introduction/examples#todos): [Source](https://github.com/reduxjs/redux/tree/master/examples/todos) | [Sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/master/examples/todos)\n- [**Todos with Undo**](https://redux.js.org/introduction/examples#todos-with-undo): [Source](https://github.com/reduxjs/redux/tree/master/examples/todos-with-undo) | [Sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/master/examples/todos-with-undo)\n- [**TodoMVC**](https://redux.js.org/introduction/examples#todomvc): [Source](https://github.com/reduxjs/redux/tree/master/examples/todomvc) | [Sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/master/examples/todomvc)\n- [**Shopping Cart**](https://redux.js.org/introduction/examples#shopping-cart): [Source](https://github.com/reduxjs/redux/tree/master/examples/shopping-cart) | [Sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/master/examples/shopping-cart)\n- [**Tree View**](https://redux.js.org/introduction/examples#tree-view): [Source](https://github.com/reduxjs/redux/tree/master/examples/tree-view) | [Sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/master/examples/tree-view)\n- [**Async**](https://redux.js.org/introduction/examples#async): [Source](https://github.com/reduxjs/redux/tree/master/examples/async) | [Sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/master/examples/async)\n- [**Universal**](https://redux.js.org/introduction/examples#universal): [Source](https://github.com/reduxjs/redux/tree/master/examples/universal)\n- [**Real World**](https://redux.js.org/introduction/examples#real-world): [Source](https://github.com/reduxjs/redux/tree/master/examples/real-world) | [Sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/master/examples/real-world)\n\n## Testimonials\n\n> [“Love what you're doing with Redux”](https://twitter.com/jingc/status/616608251463909376)\n> Jing Chen, creator of Flux\n\n> [“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)\n> Bill Fisher, author of Flux documentation\n\n> [“It's cool that you are inventing a better Flux by not doing Flux at all.”](https://twitter.com/andrestaltz/status/616271392930201604)\n> André Staltz, creator of Cycle\n\n## Thanks\n\n- [The Elm Architecture](https://github.com/evancz/elm-architecture-tutorial) for a great intro to modeling state updates with reducers;\n- [Turning the database inside-out](https://www.confluent.io/blog/turning-the-database-inside-out-with-apache-samza/) for blowing my mind;\n- [Developing ClojureScript with Figwheel](https://www.youtube.com/watch?v=j-kj2qwJa_E) for convincing me that re-evaluation should “just work”;\n- [Webpack](https://webpack.js.org/concepts/hot-module-replacement/) for Hot Module Replacement;\n- [Flummox](https://github.com/acdlite/flummox) for teaching me to approach Flux without boilerplate or singletons;\n- [disto](https://github.com/threepointone/disto) for a proof of concept of hot reloadable Stores;\n- [NuclearJS](https://github.com/optimizely/nuclear-js) for proving this architecture can be performant;\n- [Om](https://github.com/omcljs/om) for popularizing the idea of a single state atom;\n- [Cycle](https://github.com/cyclejs/cycle-core) for showing how often a function is the best tool;\n- [React](https://github.com/facebook/react) for the pragmatic innovation.\n\nSpecial thanks to [Jamie Paton](https://jdpaton.github.io) for handing over the `redux` NPM package name.\n\n## Logo\n\nYou can find the official logo [on GitHub](https://github.com/reduxjs/redux/tree/master/logo).\n\n## Change Log\n\nThis project adheres to [Semantic Versioning](https://semver.org/).\nEvery release, along with the migration instructions, is documented on the GitHub [Releases](https://github.com/reduxjs/redux/releases) page.\n\n## Patrons\n\nThe work on Redux was [funded by the community](https://www.patreon.com/reactdx).\nMeet some of the outstanding companies that made it possible:\n\n- [Webflow](https://github.com/webflow)\n- [Ximedes](https://www.ximedes.com/)\n\n[See the full list of Redux patrons](PATRONS.md), as well as the always-growing list of [people and companies that use Redux](https://github.com/reduxjs/redux/issues/310).\n\n## License\n\n[MIT](LICENSE.md)\n","authors":["Dan Abramov <dan.abramov@me.com> (https://github.com/gaearon)","Andrew Clark <acdlite@me.com> (https://github.com/acdlite)"],"exports":{".":{"types":"./types/index.d.ts","import":"./dist/es/index.js","default":"./dist/cjs/index.cjs"},"./package.json":"./package.json"},"gitHead":"5ea0614b3265763974f6e9978e33c35d6430149f","license":"MIT","npmName":"redux","scripts":{"lint":"eslint --ext js,ts src test","test":"jest && tsc -p test/typescript","build":"rollup -c","clean":"rimraf lib dist es coverage types","format":"prettier --write \"{src,test}/**/*.{js,ts}\" \"**/*.md\"","pretest":"npm run build","test:cov":"jest --coverage","test:types":"tsc -p test/typescript","test:watch":"jest --watch","check-types":"tsc --noEmit","format:check":"prettier --list-different \"{src,test}/**/*.{js,ts}\" \"**/*.md\"","examples:lint":"eslint --ext js,ts examples","examples:test":"cross-env CI=true babel-node examples/testAll.js","prepublishOnly":"npm run clean && npm run check-types && npm run format:check && npm run lint && npm test"},"_npmUser":{"name":"acemarke","email":"mark.erikson@gmail.com"},"homepage":"http://redux.js.org","keywords":["redux","reducer","state","predictable","functional","immutable","hot","live","replay","flux","elm"],"npmFileMap":[{"files":["*.js"],"basePath":"/dist/"}],"repository":{"url":"git+https://github.com/reduxjs/redux.git","type":"git"},"_npmVersion":"8.4.0","description":"Predictable state container for JavaScript apps","directories":{},"maintainers":[{"name":"gaearon","email":"dan.abramov@gmail.com"},{"name":"timdorr","email":"timdorr@timdorr.com"},{"name":"acdlite","email":"npm@andrewclark.io"},{"name":"acemarke","email":"mark.erikson@gmail.com"}],"sideEffects":false,"_nodeVersion":"16.14.0","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"glob":"^8.0.3","jest":"^29.0.3","rxjs":"^7.5.6","eslint":"^8.23.0","rimraf":"^3.0.2","rollup":"^3.12.0","ts-jest":"^29.0.0","prettier":"^2.7.1","cross-env":"^7.0.3","@babel/cli":"^7.18.10","babel-jest":"^29.0.3","typescript":"^4.8.3","@babel/core":"^7.19.0","@babel/node":"^7.18.10","@types/jest":"^29.0.0","@types/node":"^18.7.16","@babel/register":"^7.18.9","@babel/preset-env":"^7.19.0","@babel/preset-flow":"^7.18.6","eslint-plugin-react":"^7.31.8","@babel/eslint-parser":"^7.18.9","@rollup/plugin-babel":"^6","eslint-plugin-import":"^2.26.0","netlify-plugin-cache":"^1.0.3","@rollup/plugin-terser":"^0.4.0","@rollup/plugin-replace":"^5.0.0","eslint-plugin-flowtype":"^8.0.3","eslint-plugin-jsx-a11y":"^6.6.1","eslint-config-react-app":"^7.0.1","@babel/preset-typescript":"^7.18.6","@typescript-eslint/parser":"^5.36.2","eslint-plugin-react-hooks":"^4.6.0","rollup-plugin-typescript2":"^0.34.1","@rollup/plugin-node-resolve":"^15.0.1","@babel/plugin-external-helpers":"^7.18.6","@babel/plugin-transform-runtime":"^7.18.10","@typescript-eslint/eslint-plugin":"^5.36.2","eslint-import-resolver-typescript":"^3.5.1","@babel/plugin-proposal-object-rest-spread":"^7.18.9"},"_npmOperationalInternal":{"tmp":"tmp/redux_5.0.0-alpha.1_1674951041503_0.32965308944901883","host":"s3://npm-registry-packages"},"_id":"redux@5.0.0-alpha.1","version":"5.0.0-alpha.1"}