Full Stack Radio

130: David Khourshid - Building Better UI Components with State Machines


Listen Later

Topics include:

  • What exactly is a finite state machine?
  • Why trying to keep track of a component's status using boolean flags is leads to bugs and complex code
  • Why it makes so much more sense to keep track of a component's state using some sort of label
  • How simple it can actually be to implement UI component logic with a state machine and why you shouldn't think of it as complex or over-engineering
  • How you can think of using state machines in UI programming to be like an inversion of the typical approach you may have taken in the past, where actions become scoped to certain states instead of actions needing to inspect the current state
  • What events might look like in your state machine and where you're actually sending them from and to
  • Advice for naming your events
  • What it means to "transition" between states
  • How using a state machine makes it easy to provide slightly different behavior for the same action based on the current state
  • The benefits of visualizing your state machines
  • Using the XState library to build state machines in JavaScript

Sponsors:

  • Tuple, try the best pair programming app out there for free for two weeks
  • DigitalOcean, get your free $50 credit at do.co/fullstack

Links:

  • "No, disabling a button is not app logic.", David's recent article on state machines
  • XState Docs
...more
View all episodesView all episodes
Download on the App Store

Full Stack RadioBy Adam Wathan

  • 4.7
  • 4.7
  • 4.7
  • 4.7
  • 4.7

4.7

179 ratings


More shows like Full Stack Radio

View all
The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

290 Listeners

The Laravel Podcast by Taylor Otwell, Matt Stauffer

The Laravel Podcast

58 Listeners

LINUX Unplugged by Jupiter Broadcasting

LINUX Unplugged

266 Listeners

Laravel News Podcast by Jacob Bennett and Michael Dyrynda

Laravel News Podcast

56 Listeners

The Laracasts Snippet by Jeffrey Way

The Laracasts Snippet

76 Listeners

North Meets South Web Podcast by Jacob Bennett and Michael Dyrynda

North Meets South Web Podcast

24 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

984 Listeners

REWORK by 37signals

REWORK

210 Listeners

No Plans to Merge by Daniel Coulbourne & Caleb Porzio

No Plans to Merge

50 Listeners

Notes On Work - by Caleb Porzio by Caleb Porzio

Notes On Work - by Caleb Porzio

17 Listeners

Hard Fork by The New York Times

Hard Fork

5,471 Listeners

How About Tomorrow? by Adam Elmore & Dax Raad

How About Tomorrow?

20 Listeners

Mostly Technical by Ian Landsman and Aaron Francis

Mostly Technical

26 Listeners

Talking Businessly by Daniel Coulbourne & John Drexler

Talking Businessly

2 Listeners

The Panel by Justin Jackson & Brian Casel

The Panel

4 Listeners