Home / Companies / Convex / Blog / Post Details
Content Deep Dive

Local and Remote State (Making Fast5 #1)

Blog post from Convex

Post Details
Company
Date Published
Author
Jamie Turner
Word Count
1,220
Language
English
Hacker News Points
-
Summary

Convex's multiplayer game Fast5, a Wordle-style racing game, demonstrates the challenges of managing local and remote state in a React application. Fast5 uses the Convex backend as a global state manager while employing Recoil, a state management library, to handle both local and global state seamlessly within the app. The global state is maintained by the backend, updating whenever a new guess is submitted by either player, while the local state reflects the player's in-progress guesses as they type. Recoil manages these states using atoms and selectors, ensuring they are automatically updated and reflected in the game's interface. This approach prevents the game's component logic from becoming overly complex and difficult to refactor, as it separates the concerns of state management from view logic. The integration of these technologies allows Fast5 to efficiently handle the dynamic nature of a multiplayer game, providing a reactive and responsive user experience.