shelf.cafe
top new
submit sign in

State Machines in Vue: A Union Type, One Function and a Tiny useReducer

0

alexop.dev · 19d · discuss

Three refs for loading, error and data can disagree with each other. I replace them with a TypeScript union and one pure function, then wire it into Vue with a tiny useReducer composable. No library.

Sign in
shelf.cafe - just a place to share interesting blog posts and articles.
about

We can't find the internet

Attempting to reconnect

Something went wrong!

Attempting to reconnect