You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create global state selectors from local redux slice selectors.
12
-
In `redux` each of the slices are autonomus and final store structure is defined by how the individual slices are merged with `combineReducers` . `createGlobalStateSelector` takes local slice selectors and the slice structure to return global state selectors.
13
+
In `redux` each of the slices is autonomous and the final store structure is defined by how the individual slices are merged with `combineReducers`.`createGlobalStateSelector` takes local slice selectors and the slice structure to return global state selectors.
13
14
14
15
## Install
15
16
16
17
npm i create-global-state-selector
17
18
18
19
## Uses
19
-
The example below uses `redux-toolkit` however you can use `createGlobalStateSelector` with any standard Flux pattern that has multiple independent stores / slices, and are merged together with `combineReducers`.
20
-
20
+
The example below uses `redux-toolkit` however you can use `createGlobalStateSelector` with any standard Flux pattern that has multiple independent stores/slices, and are merged together with `combineReducers`.
21
+
22
+
21
23
// personalDetailsSlice.js
22
24
23
25
import { createSlice } from '@reduxjs/toolkit';
24
26
import createGlobalStateSelector from 'create-global-state-selector';
`createGlobalStateSelector` uses `Object.fromEntries` and `Object.entries` which are not pollyfilled to reduce the package size. If needed, Please add your own polyfills, or target your polyfills accordingly for Babel, Webpack, Rollup etc.
129
+
`createGlobalStateSelector` uses `Object.fromEntries` and `Object.entries` which are not pollyfilled to reduce the package size. If needed, please add your own polyfills, or target your polyfills accordingly for Babel, Webpack, Rollup, etc.
0 commit comments