diff --git a/packages/toolkit/src/query/core/buildThunks.ts b/packages/toolkit/src/query/core/buildThunks.ts index 895a9ae3c7..67291aad07 100644 --- a/packages/toolkit/src/query/core/buildThunks.ts +++ b/packages/toolkit/src/query/core/buildThunks.ts @@ -486,8 +486,6 @@ In the case of an unhandled error, no tags will be "provided" or "invalidated".` const endpointDefinition = endpointDefinitions[queryThunkArgs.endpointName] - // console.trace('Query thunk: ', currentArg) - // Order of these checks matters. // In order for `upsertQueryData` to successfully run while an existing request is in flight, /// we have to check for that first, otherwise `queryThunk` will bail out and not run at all. diff --git a/packages/toolkit/src/query/react/buildHooks.ts b/packages/toolkit/src/query/react/buildHooks.ts index d89d5f21bc..8df2eaace4 100644 --- a/packages/toolkit/src/query/react/buildHooks.ts +++ b/packages/toolkit/src/query/react/buildHooks.ts @@ -715,7 +715,7 @@ export function buildHooks({ requestId, }) ) - // console.log('Probe subscription check: ', returnedValue) + currentRenderHasSubscription = !!returnedValue } diff --git a/packages/toolkit/src/query/tests/buildHooks.test.tsx b/packages/toolkit/src/query/tests/buildHooks.test.tsx index a8122eb891..929363f4a2 100644 --- a/packages/toolkit/src/query/tests/buildHooks.test.tsx +++ b/packages/toolkit/src/query/tests/buildHooks.test.tsx @@ -89,11 +89,7 @@ let actions: AnyAction[] = [] const storeRef = setupApiStore( api, - { - // actions(state: AnyAction[] = [], action: AnyAction) { - // return [...state, action] - // }, - }, + {}, { middleware: { prepend: [listenerMiddleware.middleware], @@ -133,7 +129,9 @@ describe('hooks tests', () => { } render(, { wrapper: storeRef.wrapper }) - 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 + // By the time this runs, the initial render will happen, and the query + // will start immediately running by the time we can expect this + expect(getRenderCount()).toBe(2) await waitFor(() => expect(screen.getByTestId('isFetching').textContent).toBe('false')