MCPcopy
hub / github.com/reduxjs/redux-devtools / liftReducer

Function liftReducer

packages/redux-devtools-instrument/src/instrument.ts:1015–1033  ·  view source on GitHub ↗
(r: Reducer<S, A>)

Source from the content-addressed store, hash-verified

1013 initialState?: PreloadedState<S>
1014 ) => {
1015 function liftReducer(r: Reducer<S, A>) {
1016 if (typeof r !== 'function') {
1017 if (r && typeof (r as { default: unknown }).default === 'function') {
1018 throw new Error(
1019 'Expected the reducer to be a function. ' +
1020 'Instead got an object with a "default" field. ' +
1021 'Did you pass a module instead of the default export? ' +
1022 'Try passing require(...).default instead.'
1023 );
1024 }
1025 throw new Error('Expected the reducer to be a function.');
1026 }
1027 return liftReducerWith<S, A, MonitorState, MonitorAction>(
1028 r,
1029 initialState,
1030 monitorReducer,
1031 options as unknown as Options<S, A, MonitorState, MonitorAction>
1032 );
1033 }
1034
1035 const liftedStore = createStore(liftReducer(reducer));
1036 if (

Callers 2

replaceReducerFunction · 0.85
instrumentFunction · 0.85

Calls 1

liftReducerWithFunction · 0.85

Tested by

no test coverage detected