Advanced
Milestone 5: optimistic moves with rollback
The board loads from a fake API that takes 300 ms. Moving a card waits for the server, and failures are ignored. Make moveTask optimistic.
Move the card at once, then call api.moveTask. If it throws, move only that card back to where it was and put a message containing Could not move into alertStore (it shows in a role="alert" banner).
Tick #server-down to make every request fail. The app opens on /?priority=high, so you see Build static components (Doing) and Plan the board (Done).
What Check tests
- The board loads from the fake API
- A move shows at once, before the server answers
- After the server agrees, the card stays and there is no error
- When the server fails, the card moves, then comes back with a message
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.