$chiubaca / notes / fleeting / 2022-06-15
  • I should start learning about state machines

Whenever you set boolean flags like:

🏳️ setIsLoading(true)
🏳️ setIsActive(true)
🏳️ setHasFailed(true)

You're not avoiding a state machine. You're creating an implicit one, where the transition function lives in your head, and is hopefully the same as your teammates (unlikely).

— David K. 🎹 (@DavidKPiano) June 15, 2022
  • https://stately.ai/blog/state-management-how-to-tell-a-bad-boolean-from-a-good-boolean
Edit on GitHub ✏️

Hey I'm Alex Chiu 👋. These are my notes for literally anything.

I'm using the Zettelkasten method to organise my thoughts here.

My more polished writings are published to my main blog at chiubaca.com

Follow me on: Github / X (Twitter) / Mastodon / LinkedIn