3.0.0-alpha.4 • Published 1 year ago
@redux-eggs/redux-toolkit v3.0.0-alpha.4
Redux Eggs for Redux Toolkit
Redux Eggs wrapper for Redux Toolkit.
Contents:
Installation:
If you are using Yarn, run
yarn add @redux-eggs/core @redux-eggs/redux-toolkit
If you are using NPM, run
npm install --save @redux-eggs/core @redux-eggs/redux-toolkit
⚠️ Minimum supported versions of peer dependencies:
@reduxjs/toolkit
1.6.0 and newer
Usage
Create your store:
import { createStore } from '@redux-eggs/redux-toolkit'
export const store = createStore()
Add reducer from slice to egg
:
// my-egg.js
import { mySlice } from '../my-slice'
export const getMyEgg = () => {
return {
id: 'my-egg',
reducersMap: {
myState: mySlice.reducer,
// ...
},
// ...
}
}
// my-another-egg.js
import { myAnotherSlice } from '../my-another-slice'
export const getMyAnotherEgg = () => {
return {
id: 'my-another-egg',
reducersMap: {
myAnotherState: myAnotherSlice.reducer,
// ...
},
// ...
}
}
Add egg
to your store:
import { getMyEgg } from '../eggs/my-egg'
// Somewhere in your application
store.addEggs([getMyEgg()])
// Somewhere else
import { getMyAnotherEgg } from '../eggs/my-another-egg'
// Somewhere in your application
store.addEggs([getMyAnotherEgg()])
3.0.0-alpha.3
1 year ago
3.0.0-alpha.4
1 year ago
2.2.0
2 years ago
2.1.0
2 years ago
2.0.0
2 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago