Skip to content

Commit feccd87

Browse files
committed
Assorted other cleanup
1 parent 1696f7a commit feccd87

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

packages/toolkit/src/query/core/buildThunks.ts

-2
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,6 @@ In the case of an unhandled error, no tags will be "provided" or "invalidated".`
486486
const endpointDefinition =
487487
endpointDefinitions[queryThunkArgs.endpointName]
488488

489-
// console.trace('Query thunk: ', currentArg)
490-
491489
// Order of these checks matters.
492490
// In order for `upsertQueryData` to successfully run while an existing request is in flight,
493491
/// we have to check for that first, otherwise `queryThunk` will bail out and not run at all.

packages/toolkit/src/query/react/buildHooks.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
715715
requestId,
716716
})
717717
)
718-
// console.log('Probe subscription check: ', returnedValue)
718+
719719
currentRenderHasSubscription = !!returnedValue
720720
}
721721

packages/toolkit/src/query/tests/buildHooks.test.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,7 @@ let actions: AnyAction[] = []
8989

9090
const storeRef = setupApiStore(
9191
api,
92-
{
93-
// actions(state: AnyAction[] = [], action: AnyAction) {
94-
// return [...state, action]
95-
// },
96-
},
92+
{},
9793
{
9894
middleware: {
9995
prepend: [listenerMiddleware.middleware],
@@ -133,7 +129,9 @@ describe('hooks tests', () => {
133129
}
134130

135131
render(<User />, { wrapper: storeRef.wrapper })
136-
expect(getRenderCount()).toBe(2) // By the time this runs, the initial render will happen, and the query will start immediately running by the time we can expect this
132+
// By the time this runs, the initial render will happen, and the query
133+
// will start immediately running by the time we can expect this
134+
expect(getRenderCount()).toBe(2)
137135

138136
await waitFor(() =>
139137
expect(screen.getByTestId('isFetching').textContent).toBe('false')

0 commit comments

Comments
 (0)