T
TanStack3y ago
other-emerald

Is there a way to set isLoading state manually (using query key)?

I am using websocket with react query. I found TkDodo's awesome blog on this I want to follow the approach in which I receive 2 things from backend in one WS message:- 1. query key to do queryClient.setQueriesData() 2. data payload But when using websocket I also want loading is fetching states. Since I am using websockets there is no Request promises i guess. Thus, I get no isLoading, isFetching states Is it possible to manually set these two states? My backend can send flags in each message to tell if data sending is complete or not.
my usecase:- I have a long running process whose data is sent to frontend every second and it eventually ends at some time. I want a loading state for this thing
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?