Adds Redux and React-Intl to storybook (#35094)
This commit is contained in:
parent
c4128d89c9
commit
8ee8231a43
10 changed files with 876 additions and 53 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Record as ImmutableRecord } from 'immutable';
|
||||
import { Record as ImmutableRecord, mergeDeep } from 'immutable';
|
||||
|
||||
import { loadingBarReducer } from 'react-redux-loading-bar';
|
||||
import { combineReducers } from 'redux-immutable';
|
||||
|
|
@ -98,6 +98,15 @@ const initialRootState = Object.fromEntries(
|
|||
|
||||
const RootStateRecord = ImmutableRecord(initialRootState, 'RootState');
|
||||
|
||||
const rootReducer = combineReducers(reducers, RootStateRecord);
|
||||
export const rootReducer = combineReducers(reducers, RootStateRecord);
|
||||
|
||||
export { rootReducer };
|
||||
export function reducerWithInitialState(
|
||||
stateOverrides: Record<string, unknown> = {},
|
||||
) {
|
||||
const initialStateRecord = mergeDeep(initialRootState, stateOverrides);
|
||||
const PatchedRootStateRecord = ImmutableRecord(
|
||||
initialStateRecord,
|
||||
'RootState',
|
||||
);
|
||||
return combineReducers(reducers, PatchedRootStateRecord);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue