I'm using this to trigger a mutate for the current key model.
Since i'm doing this
const { data, error, size, setSize, mutate } = useSWRInfinite<
MediaDiaryWithId[]
>(
(_, prev) => {
// We've reached the end of the list since we got < 30, don't call again
if (prev && prev.length < 30) return null;
return [
"/fuego/diary",
user.uid,
prev !== null ? prev[prev.length - 1].addedDate : null,
state.bookmarkFilters?.mediaType ?? null,
state.bookmarkFilters?.releasedDecade ?? null,
state.bookmarkFilters?.addedDate ?? null,
state.bookmarkFilters?.genre ?? null,
];
},
fuegoBookmarkGet,
{
revalidateOnFocus: false,
}
);
I can't mutate based on key, so there's a lag when I click and mutate. I'm assuming some kind of race condition maybe. Not sure. But there is something is happening between those states that aren't allowing for proper instant mutation of the keys
Problem
I'm using this to trigger a mutate for the current key model.
Since i'm doing this
I can't mutate based on key, so there's a lag when I click and mutate. I'm assuming some kind of race condition maybe. Not sure. But there is something is happening between those states that aren't allowing for proper instant mutation of the keys