Skip to content

skryukov/izzy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Izzy

She moves cards to "Done" before anyone's actually checked with the server.

A tiny kanban board built with Rails, Inertia.js, and React to demonstrate optimistic UI patterns. Izzy is the demo app for the blog post Optimistic UI in Rails with optimism... and Inertia.

Sponsored by Evil Martians

What's This About?

You know that brief pause after you click something? That moment where your brain goes "did it work?" Izzy eliminates that by lying to you. Convincingly.

Drag a card, and it moves instantly. Submit a todo, and it appears immediately. The server catches up later. If something goes wrong, Inertia quietly fixes things. You never notice the deception.

Installation

git clone https://github.com/skryukov/izzy.git
cd izzy
bin/setup

Test Coverage

Tests:   0 passed, 0 total

We're optimistic it works.

Key Files

The interesting stuff lives here:

  • app/frontend/pages/todos/index.tsx — The kanban board with optimistic updates
  • app/controllers/todos_controller.rb — A controller so simple it barely exists

The Pattern in 30 Seconds

// 1. Update UI instantly
router.replaceProp("todos", (todos) => [
  ...todos,
  { text: "New todo", status: "todo", pending: true },
])

// 2. Tell the server (it'll catch up)
router.post(todos_path(), { text: "New todo" })

// 3. Server response replaces props automatically
// If we were wrong, the UI corrects itself. No drama.

That's it. That's the whole trick.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published