Skip to content

Commit

Permalink
🐛 containerReducer/getInitialState: use special action type while obt…
Browse files Browse the repository at this point in the history
…aining initial state of child reducer
  • Loading branch information
cermakjiri committed Mar 14, 2022
1 parent 445a662 commit b0d8eb2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/reducers/container/factoryReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import type { AnyAction } from '@reduxjs/toolkit';

import { config, emptyActionTypesError, ReduxUtilsError, undefinedItemIdWarning } from '../../config';
import type { ApiState, ContainerCustomParams, ContainerState } from '../../config';
import { UNUSED_ACTION_TYPE } from '../../constants';

function getInitialState<S>({
childReducer,
initialState: customInitialState,
options,
}: Pick<ContainerCustomParams<S>, 'childReducer' | 'initialState' | 'options'>): ContainerState<S> {
const placeholder = childReducer(undefined, { type: UNUSED_ACTION_TYPE });
const placeholder = childReducer(undefined, { type: 'INIT_ACTION_TYPE' });
const initialState = { ...customInitialState };

if (placeholder && options.placeholder) {
Expand Down

0 comments on commit b0d8eb2

Please sign in to comment.