惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
A
About on SuperTechFans
G
Google Developers Blog
B
Blog RSS Feed
F
Fortinet All Blogs
WordPress大学
WordPress大学
Recent Announcements
Recent Announcements
Hugging Face - Blog
Hugging Face - Blog
Y
Y Combinator Blog
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
Jina AI
Jina AI
IT之家
IT之家
P
Proofpoint News Feed
美团技术团队
量子位
Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
B
Blog
有赞技术团队
有赞技术团队
U
Unit 42

Full Stack Radio

153: DHH – Omarchy and Designing Your Own OS on Arch Linux | Full Stack Radio | Episode 153 152: Ben Orenstein - How to Stand Out When Applying for a Job at a Small Company | Full Stack Radio | Episode 152 151: DHH – Building HEY with Hotwire | Full Stack Radio | Episode 151 150: Secret Screencasting Tips & Behind the Scenes of Tailwind CSS 2.0 | Full Stack Radio | Episode 150 149: Choosing a Payment Processor, Radical Icons & W3C Hype | Full Stack Radio | Episode 149 148: Accessible Focus Styles, Tailwind Labs on YouTube, and Secret Projects | Full Stack Radio | Episode 148 147: Surviving GitHub Issues, the Statamic 3 Launch Aftermath, Tailwind 1.8, and Headless UI | Full Stack Radio | Episode 147 146: Launching Statamic 3, GitHub Sponsors, Tailwind CSS v1.7, and Preparing for Laracon | Full Stack Radio | Episode 146 145: Statamic 3.0 and Tailwind CSS 2.0 | Full Stack Radio | Episode 145 144: Gary Bernhardt - TypeScript and Testing | Full Stack Radio | Episode 144 143: Rich Harris - Svelte and Defending the Modern Web | Full Stack Radio | Episode 143 142: Jason Cohen - Learning to Hire and Manage a Team | Full Stack Radio | Episode 142 141: Jason Fried - Running the Tailwind Business on Basecamp | Full Stack Radio | Episode 141 140: Evan You - Reimagining the Modern Dev Server with Vite | Full Stack Radio | Episode 140 139: Alex DeBrie - DynamoDB for Relational Database Diehards | Full Stack Radio | Episode 139 138: Tom Preston-Werner - Building Full-Stack JS Apps with Redwood.js | Full Stack Radio | Episode 138 137: Tim Neutkens - Continuing to Innovate with Next.js 9.3 | Full Stack Radio | Episode 137 136: Michael Chan - React Is Not a Rails Competitor | Full Stack Radio | Episode 136 135: Lessons Learned Building Tailwind UI | Full Stack Radio | Episode 135 134: Mark Dalgleish - You Should Be Using Layout Components | Full Stack Radio | Episode 134 133: Sam Selikoff - Building Production-Ready SPAs Fast with Mirage.js | Full Stack Radio | Episode 133 132: Caleb Porzio - Just Enough JavaScript with Alpine.js | Full Stack Radio | Episode 132 131: Ryan Singer - How Basecamp Builds Software | Full Stack Radio | Episode 131 129: Evan You - What's Coming in Vue.js 3.0 | Full Stack Radio | Episode 129 128: Alasdair Monk - Scaling CSS at Heroku with Utility Classes | Full Stack Radio | Episode 128 127: Jonathan Reinink - Building Modern Monoliths with Inertia.js | Full Stack Radio | Episode 127 126: James Long - Building Distributed Local-First JavaScript Applications | Full Stack Radio | Episode 126 125: Rob Walling - Choosing the Right Product Idea | Full Stack Radio | Episode 125 124: Leslie Cohn-Wein & Rafael Conde - Designing the User Interface at Netlify | Full Stack Radio | Episode 124 123: Ian Landsman - Marketing and Positioning a New Tailwind CSS Product | Full Stack Radio | Episode 123
130: David Khourshid - Building Better UI Components with...
Adam Wathan · 2019-12-12 · via Full Stack Radio

In this episode, Adam talks to David Khourshid about using state machines to build UI components that are simpler and more resilient to bugs.

Show Notes

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:

Links:

What is Full Stack Radio?

A podcast for developers interested in building great software products. Every episode, Adam Wathan is joined by a guest to talk about everything from product design and user experience to unit testing and system administration.