Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Immer | 25,927 | 87,980 | 4,052 | 5 days ago | 170 | May 09, 2023 | 43 | mit | JavaScript | |
Create the next immutable state by mutating the current one | ||||||||||
Redux Toolkit | 9,854 | 25 | 2,635 | 7 days ago | 75 | May 30, 2023 | 279 | mit | TypeScript | |
The official, opinionated, batteries-included toolset for efficient Redux development | ||||||||||
Ducks Modular Redux | 9,156 | 2 years ago | 36 | JavaScript | ||||||
A proposal for bundling reducers, action types and actions when using Redux | ||||||||||
Rematch | 8,175 | 210 | 156 | a year ago | 76 | November 09, 2021 | 19 | mit | TypeScript | |
The Redux Framework | ||||||||||
Reswift | 7,446 | 155 | 21 days ago | 9 | January 15, 2018 | 47 | mit | Swift | ||
Unidirectional Data Flow in Swift - Inspired by Redux | ||||||||||
Redux Ecosystem Links | 5,201 | 3 months ago | 31 | |||||||
A categorized list of Redux-related addons, libraries, and utilities | ||||||||||
Connected React Router | 4,731 | 2,066 | 710 | 7 months ago | 51 | July 11, 2022 | 175 | mit | JavaScript | |
A Redux binding for React Router v4 | ||||||||||
Store | 3,982 | 2 | 6 years ago | 8 | June 07, 2017 | 10 | mit | TypeScript | ||
RxJS powered state management for Angular applications, inspired by Redux | ||||||||||
Redux Orm | 2,965 | 82 | 37 | 8 months ago | 70 | August 11, 2021 | 115 | mit | JavaScript | |
NOT MAINTAINED – A small, simple and immutable ORM to manage relational data in your Redux store. | ||||||||||
Redux Undo | 2,855 | 637 | 209 | 2 months ago | 41 | July 17, 2023 | 35 | mit | JavaScript | |
:recycle: higher order reducer to add undo/redo functionality to redux state containers |
Combines reducers from redux-ducks modules into a single reducer.
It uses reducers defined as ducks, see ducks-modular-redux (aka isolated modules), and creates a reducer combining their reducers with combineReducers.
Install with npm:
npm install ducks-reducer
import ducksReducer from 'ducks-reducer'
import * as comments from './comments'
import * as posts from './posts'
import * as users from './users'
const reducer = ducksReducer({ comments, posts, users })
// ...do your stuff...
const store = createStore(reducer, preloadedState, enhancer)
// ...do your stuff...
It creates a reducer with combineReducers
with all the reducers
of the given reducers.
By default, it assumes that ducks are esModules and it looks for
the default
property which is suposed to be the reducer:
const reducer = ducksReducer({ comments, posts, users })
// ^ this is equivalent to v
const reducer = combineReducers({
comments: comments.default,
posts: posts.default,
users: users.default,
})
If default
is not found in any duck, then it assumes that it may be
an ES5 module. Then it looks for the duck itself, if it is a function,
then it is considered the reducer.
const reducer = ducksReducer({ comments, posts, users })
// ^ this is equivalent to v
const reducer = combineReducers({ comments, posts, users })
If the duck does not have a default
and the duck itself is not a function,
then it assumes that there is no reducer for that duck.
It supports to combine all three kinds of ducks (es6 modules, es5 modules and with no reducer).
const reducer = ducksReducer({ comments, posts, users })
// ^ this is equivalent to v
const reducer = combineReducers({
comments: comments.default, // it was es6 module
posts: posts, // it was es5 module
// users had no reducer
})
ducks-middleware to compose ducks middlewares.
import ducksReducer from 'ducks-reducer'
import ducksMiddleware from 'ducks-middleware'
import * as comments from './comments'
import * as posts from './posts'
import * as users from './users'
const ducks = { comments, posts, users }
const reducer = ducksReducer(ducks)
const middleware = ducksMiddleware(ducks)
// ...do your stuff...
const store = createStore(
reducer,
preloadedState,
applyMiddleware(middleware)
)
// ...do your stuff...