Skip to content

Commit

Permalink
enhance: Simplify fetchReducer code
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Jul 8, 2024
1 parent 96f7eb0 commit 3ffa454
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-sheep-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@data-client/core': patch
---

internal: Simplify fetchReducer code
5 changes: 1 addition & 4 deletions packages/core/src/state/reducer/fetchReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ export function fetchReducer(state: State<unknown>, 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 */
Expand Down

0 comments on commit 3ffa454

Please sign in to comment.