Make every feature feel instant, be collaborative, and work offline. No extra code required.
It's easier than ever to build apps these days, especially when you're using AI. However, making something delightful is still hard. When you look at some of the best apps today, they all have certain features in common.
Every interaction is instant
There is no loading spinner, lag, or waiting. When you click a button, the app responds immediately.
Collaboration is enabled by default
No need to pull to refresh. You can work together in real-time and see each other's changes instantly.
Apps keep working even when you're offline
You can keep using the app and your changes will sync when you come back online. Imagine using your favorite note-taking app and it doesn't load when your connection is spotty. That's not delightful.
Want to add these features to your app on your own? Here's what you'll need to build.
Users want instant feedback. Without optimistic updates, every action waits for a server round trip.
When a user makes a change we first apply it to a local store so users see the update immediately. We'll also need to track this as a pending mutation. That way we can rollback if the server rejects the mutation. If the server accepts, we clear the mutation from the pending queue.
Server Result
Pending Mutations
Alyssa
Server
Alyssa sees a gray ball
Alyssa has a browser open and sees a gray ball. What happens when she changes the color?
This is a lot of code!
Doing it by hand will probably take too long. Even if AI writes it, you'll need to maintain it for every feature you build.
In the past companies would hire a team of elite engineers to build a custom sync engine. In the future all apps will have sync by default.