T
TanStack11mo ago
foreign-sapphire

proper way of handling optimistic updates

Hey, I wanna ask you - How to proper handle optimistic updates in this scenario? 1. User create task 2. I create task with fake id on unmutate and imedietly show this task to user 3. user instatnly want to delete this task with fake id (cuz he has slow internet and post request for creating task does not completed yet so we do not have real id for this moment.) 4. hitting endpoint with fake id make server response with 404 and not deleting this task How to hanbdle this scenerio? I was thinking about queueing all requests - is it ok solution? maybe there are any good tutorials for this?
1 Reply

Did you find this page helpful?