kea
redux-toolkit
Our great sponsors
kea | redux-toolkit | |
---|---|---|
4 | 197 | |
1,854 | 8,010 | |
2.0% | 4.4% | |
7.3 | 9.5 | |
9 days ago | 1 day ago | |
JavaScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
kea
-
Best stack for starting out a new commercial React project.
Whereas with Redux (and abstractions such as Kea) you subscribe to specific parts of the redux tree on a per-component level. Said differently, if you only update one value in Redux, only the components that read it will update. With Context, the entire app will update.
- Keep your state in Kea and your views in React
- Kea: Production Ready React State Management
redux-toolkit
-
Extreme Explorations of TypeScript's Type System
We do a _lot_ of this in the Redux library repos (examples: [0] [1] [2] ). We have some incredibly complicated types in our libraries, and we have a bunch of type tests to confirm expected behavior.
Generally, these can just be some TS files that get compiled with `tsc`, but it helps to have a bunch of type-level assertions about expected types.
I actually recently gave a talk on "Lessons Learned Maintaining TS Libraries" [3], and had a couple slides covering the value of type tests and some techniques.
[0] Redux Toolkit's `createSlice`: https://github.com/reduxjs/redux-toolkit/blob/9e24958e6146cd...
[1] Reselect's `createSelector`: https://github.com/reduxjs/reselect/blob/f53eb41d76da0ea5897...
[2] React-Redux's `connect`: https://github.com/reduxjs/react-redux/blob/720f0ba79236cdc3...
[3] https://blog.isquaredsoftware.com/2022/05/presentations-ts-l...
-
Question with this Utility Type
The utility type below is taken from redux-toolkit, it checks whether or not a type could be undefined and then returns the given types, acting like a ternary:
-
Redux Best Practices
Redux Toolkit is a wrapper library written for the original Redux for the sake of making it easier, and faster to use Redux by reducing the boilerplate and introducing features such as thunks out of the box without having to install third-party libraries.
-
How to use React with Redux
Now we need 2 libraries for redux, the first one has the redux API and the second one has the Redux configured to be used with React.
-
Prevent Acid Redux with Redux Toolkit
Redux Toolkit is a tool that abstracts a lot of the heavy lifting associated with Redux.
-
Implement state in React using Redux Toolkit (easy way🔥)
Redux Toolkit is an all in one state management library for React.js. It helps you to create and manage global state easily with a lot less boiler plate code. Redux toolkit is basically an extension on Redux and other dependent packages, functions for state management. It simplifies most Redux tasks, prevents common mistakes, and makes it easier to write Redux applications.
-
So what?
We tried to get dev time to overcome this problem, since we’d have to make Redux stream-friendly in a React 18 world anyway. Unfortunately, Redux and its ecosystem weren’t designed with streaming in mind, so assigning enough dev time to overcome those obstacles was deemed “not product-led enough”.
-
#28: Full-Stack SWA: React + Mongoose
Front-end built with React and Redux Toolkit
-
Replacing objects in Redux store
Firstly, I strongly recommend that you look at the redux-toolkit which is a modern way to use redux which is easier to use and better in every way.
PS: prefer Redux Toolkit over plain Redux, you wouldn't get your current error in the first place if you were using Redux Toolkit
What are some alternatives?
redux-saga - An alternative side effect model for Redux apps
zustand - 🐻 Bear necessities for state management in React
redux-thunk - Thunk middleware for Redux
react-query - 🤖 Powerful asynchronous state management, server-state utilities and data fetching for TS/JS, React, Solid, Svelte and Vue. [Moved to: https://github.com/TanStack/query]
next-redux-wrapper - Redux wrapper for Next.js
vite - Next generation frontend tooling. It's fast!
Immer - Create the next immutable state by mutating the current one
Recoil - Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.
redux - Predictable state container for JavaScript apps
ducks-modular-redux - A proposal for bundling reducers, action types and actions when using Redux
redux-persist - persist and rehydrate a redux store
react-clean-architecture - A realistic approach to implement clean architecture on react codebases