Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
A new state of mind: Building better web apps w...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Adam Michael Daw
May 27, 2020
Programming
48
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
A new state of mind: Building better web apps with finite-state machines
Adam Michael Daw
May 27, 2020
Other Decks in Programming
See All in Programming
すこし踏み込む CancellationToken
htkym
2
1.7k
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
790
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
ActionController meets Protocol Buffers
sorah
0
520
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
Event is what happens
moro
2
770
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
180
golang-bob.pdf
iwatsukayura
0
130
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
460
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
410
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Amusing Abliteration
ianozsvald
1
350
How to train your dragon (web standard)
notwaldorf
96
6.9k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
460
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
820
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Transcript
A NEW STATE OF MIND BUILDING BETTER WEB APPS WITH
FINITE-STATE MACHINES
ADAM DAW TWITTER: @ADAMDAW GITHUB: ADAMDAW
WHAT IS A FINITE-STATE MACHINE? ANY (ABSTRACT) MACHINE THAT CAN
BE IN EXACTLY ONE OF A FINITE NUMBER OF STATES AT A GIVEN TIME.
THINGS TO KNOW • NOT NEW (THOUGH RECENTLY GAINING POPULARITY)
• NOT CODE (THOUGH MANY IMPLEMENTATIONS HAVE BEEN INTRODUCED) • NOT HARD (THOUGH STARTING TO THINK OF THINGS IN THIS FASHION MIGHT BE)
EXAMPLES IN THE WILD A CHECKBOX (2 STATES: CHECKED, UNCHECKED)
A DOOR (2 STATES: OPEN, CLOSED) A PROMISE (3 STATES: PENDING, REJECTED, FULFILLED)
WHY STATE MACHINES? • IMPLICIT STATE • Booleans such as
(loading/doneloading) • EXPLICIT STATE • states: { loading: {…}, error: {…}, idle: {…}, success: {…}} • CLEANER CONCEPTUALIZATION OF BEHAVIOUR • BETTER MAPPING OF TRANSITIONS • PARADIGM SHIFT: EVENT-ACTION TO EVENT-STATE-ACTION
VISUALIZING STATE • 2 STATES : • Locked (initial) •
Coin: un-locked • Un-locked • Push: locked
VISUALIZING STATE PT 2 • 3 STATES : • Idle
(initial) • Click : fetching • Fetching • Failure: error • Success: idle • Error • Retry: fetching
LET’S SEE IT IN CODE!
SUMMARY • CLEANER TRANSITIONS BETWEEN STATES • BETTER UNDERSTANDING OF
BEHAVIOUR • LESS CODE TO COVER FOR TESTING • Can automate integration testing • MOVE FROM EVENT-ACTION TO EVENT-STATE-ACTION TODAY!
Q & A?