diff --git a/src/store/reducers.ts b/src/store/reducers.ts index b6574de..bacbdf0 100644 --- a/src/store/reducers.ts +++ b/src/store/reducers.ts @@ -29,7 +29,6 @@ function fetchTypeRecord() { return Record>({ value: null as T | null, error: undefined, - fetching: undefined, }); } @@ -70,13 +69,12 @@ function fetchTypeIdentityReducer( if (action.error) { return state.set('error', action.payload); } else { - const fetching = (action.payload === undefined) ? true : undefined; const payload = (action.payload === undefined) ? null : action.payload; state = state.set('error', undefined); - if (fetching) { - return state.set('fetching', fetching); + if (action.payload === undefined) { + return state; } let value = state.get('value', null); @@ -89,10 +87,7 @@ function fetchTypeIdentityReducer( } else { value = null; } - return state.merge({ - value, - fetching, - }); + return state.set('value', value); } }