diff --git a/.changeset/eighty-sheep-occur.md b/.changeset/eighty-sheep-occur.md new file mode 100644 index 000000000000..26941c724680 --- /dev/null +++ b/.changeset/eighty-sheep-occur.md @@ -0,0 +1,5 @@ +--- +'@data-client/core': patch +--- + +internal: Simplify fetchReducer code diff --git a/packages/core/src/state/reducer/fetchReducer.ts b/packages/core/src/state/reducer/fetchReducer.ts index 9727be0d7c78..769666335f18 100644 --- a/packages/core/src/state/reducer/fetchReducer.ts +++ b/packages/core/src/state/reducer/fetchReducer.ts @@ -10,10 +10,7 @@ export function fetchReducer(state: State, action: FetchAction) { let setAction: SetResponseAction | OptimisticAction; if (action.endpoint.getOptimisticResponse && action.endpoint.sideEffect) { - setAction = createOptimistic(action.endpoint, { - args: action.meta.args, - fetchedAt: action.meta.fetchedAt, - }); + setAction = createOptimistic(action.endpoint, action.meta); } else { // If 'fetch' action reaches the reducer there are no middlewares installed to handle it /* istanbul ignore next */