diff --git a/packages/data/src/redux-store/metadata/reducer.ts b/packages/data/src/redux-store/metadata/reducer.ts index 905d798ca64258..3baa2f6b26d8c4 100644 --- a/packages/data/src/redux-store/metadata/reducer.ts +++ b/packages/data/src/redux-store/metadata/reducer.ts @@ -4,23 +4,36 @@ import EquivalentKeyMap from 'equivalent-key-map'; import type { Reducer } from 'redux'; +/** + * Internal dependencies + */ +import type { + startResolution, + finishResolution, + failResolution, + startResolutions, + finishResolutions, + failResolutions, + invalidateResolution, + invalidateResolutionForStore, + invalidateResolutionForStoreSelector, +} from './actions'; + /** * Internal dependencies */ import { selectorArgsToStateKey, onSubKey } from './utils'; type Action = - | ReturnType< typeof import('./actions').startResolution > - | ReturnType< typeof import('./actions').finishResolution > - | ReturnType< typeof import('./actions').failResolution > - | ReturnType< typeof import('./actions').startResolutions > - | ReturnType< typeof import('./actions').finishResolutions > - | ReturnType< typeof import('./actions').failResolutions > - | ReturnType< typeof import('./actions').invalidateResolution > - | ReturnType< typeof import('./actions').invalidateResolutionForStore > - | ReturnType< - typeof import('./actions').invalidateResolutionForStoreSelector - >; + | ReturnType< typeof startResolution > + | ReturnType< typeof finishResolution > + | ReturnType< typeof failResolution > + | ReturnType< typeof startResolutions > + | ReturnType< typeof finishResolutions > + | ReturnType< typeof failResolutions > + | ReturnType< typeof invalidateResolution > + | ReturnType< typeof invalidateResolutionForStore > + | ReturnType< typeof invalidateResolutionForStoreSelector >; type StateKey = unknown[] | unknown; export type StateValue = @@ -142,8 +155,9 @@ const isResolved = ( state: Record< string, State > = {}, action: Action ) => { case 'FAIL_RESOLUTIONS': case 'INVALIDATE_RESOLUTION': return subKeysIsResolved( state, action ); + default: + return state; } - return state; }; export default isResolved;