Jacob Jaffe
Jacob Jaffe
Yeah-- it would be pretty sweet to be able to do: ```tsx // Optimistic patch example, within-consumer const { data: profile, patch: patchProfile } = useGetProfileQuery(userId); const [updateProfileMutation] = useUpdateProfileMutation();...
Probably this... https://github.com/radix-ui/website/blob/11f0607c5130fb3b5d082962fdc17d1846511c47/components/Scale.tsx#L32
Demo: https://github.com/JacobJaffe/rtk-infinite-next-page-demo simple reproduction of this -- open up the console, and see that `onQueryStarted` keeps getting called when load more is pressed, after the faked end-of-list behavior
Right now, I'm working on hacking a fix by keeping track of already-handled `queryFulfilled` cases via a global scope map, and no-oping within `onQueryStarted` if so. Curious if there's a...
Am digging around a little, and I see that this in `buildHooks.ts`: ```ts export type LazyInfiniteQueryTrigger< D extends InfiniteQueryDefinition, > = { /** * Triggers a lazy query. * *...
Taking a stab getting into the weeds on this. I've got a better reproduction of this within the `inifiniteQueries.test.ts` test suite: https://github.com/reduxjs/redux-toolkit/compare/master...JacobJaffe:redux-toolkit:infinite-query-fetch-next-lifecycle-bug?expand=1#diff-603de156f749730b38436153548990e6af8355cadd0d68f041a0aa78c9771337 I've confirmed here a more general case: ```ts...
It looks like the case is specifically hit in: `if (param == null && data.pages.length)` https://github.com/reduxjs/redux-toolkit/blob/master/packages/toolkit/src/query/core/buildThunks.ts#L546 Could `meta` be returned with a flag in that case? This would allow a...
What if the hooks themselves, ```ts const fetchNextPage = () => { return trigger(stableArg, 'forward') } const fetchPreviousPage = () => { return trigger(stableArg, 'backward') } ``` [(buildHooks.ts)](https://github.com/reduxjs/redux-toolkit/blob/master/packages/toolkit/src/query/react/buildHooks.ts#L2122) checked for...
FWIW, I confirmed this bug occurs on both immer 11.0.0, and 11.0.1.
Working on creating a reproduction of this. The combination of variables is making it tricky, and my production app is running on 10.0.3 as a workaround for now.