Unless you don't want to use saga's, it's recommended to install
redux-saga-area
instead ofredux-area
Short: Simplified strongly typed redux
When defining redux actions and reducers with typescript, you often need a lot of typing for interfaces to ensure that you can use your actions, action-creators and reducers with autocompletion ect.
Redux-area tries to simplify creation of redux logic by hiding / calculating types, keeping the code more clean.
The goal is: to ease and reduce the amount of code we need to write to get all benefits of both
- redux (single truth, deterministic state transition and view rendering, time travel ect..) and
- typescript (strongly typed symbols and interfaces, code checking/nullable check, auto-rewriting, autocompletion, auto-importing ect..).
Redux-area uses the immer npm module for keeping the reducers as simple as possible.
You can create normal reducers if you need them
Github Source Code (The npm package)
See codesandbox Demo in React
See Github Wiki for full Documentation
redux-saga-area Same functionality with added redux-saga functionality
react-redux-area is another module the add React specific functionality to redux-area:
npm install redux-area
Or
yarn add redux-area
You need to have installed: "immer": "^5.x", "redux": "^4.x",
Full install
yarn add immer redux redux-area
(editable codesandbox.io)
Demo: Demo in React