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
React + Statecharts: Repensando seu frontend co...
Search
Filipe Monteiro
June 02, 2018
Programming
570
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React + Statecharts: Repensando seu frontend com máquina de estados finitos
Filipe Monteiro
June 02, 2018
Transcript
28 slides
Filipe Monteiro
React + Statecharts Repensando seu frontend com máquina de estados
Gerenciar estado é difícil
AutoLogout component •Definir um estado inicial de logado e trabalhando
•Observa o mouse move / key down •Uma vez idle, após algum tempo definido •Logout
None
None
None
Bottom-up •Foca em transições lineares •Difícil de entender •Mais suscetível
a bugs a medida que o código cresce •Cria estados não previsíveis
Statecharts
Máquina de estados finitos “ Uma máquina abstrata que está
em um único estado em determinado momento”
Máquina de estados finitos “ Que pode mudar de um
estado para outro de acordo com uma entrada/evento”
Máquina de estados finitos A B B C C
Statecharts
“ Um conceito visual para sistemas complexos” David Harel, 1987
Statecharts São uma extensão ou uma máquina de estados melhorada.
Statecharts •Estados aninhados (clustering) •Ortogonalidade •Condições nas transações (guards) •Ações
(onEntry, onExit)
Statecharts “ Um statechart é uma caixa mágica: Você fala
o que aconteceu e ela te diz o que fazer” Luca Matteis, 2018
xstate + react-automata
None
None
None
None
None
None
None
None
“Tendência para 2018: Todo mundo vai começar a usar máquina
de estado (explícita) para UIs” Max Stoiber, 2018
Obrigado!
More Decks by Filipe Monteiro
See All by Filipe Monteiro
React + Statecharts - Repensando seu frontend com máquina de estados
filipemonteiroth
1
110
Other Decks in Programming
See All in Programming
Modernizing iOS Apps
seyfoyun
0
150
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
170
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.2k
AI Augmentation Techniques with Liberty
ivargrimstad
1
440
Distance field of Julia set
kinakomoti321
0
320
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
260
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
140
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
160
地方こそサーバーレス — 10年続けた、顔が見えるチームで確かな基盤を / Serverless Matters Most in Regional Areas — 10 Years of Building Reliable Foundations with Close-Knit Teams
seike460
PRO
1
340
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
420
はじめてのPLATEAU
nokonoko1203
1
640
ActionController meets Protocol Buffers
sorah
1
800
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Exploring anti-patterns in Rails
aemeredith
4
560
BBQ
matthewcrist
90
10k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
310
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
A designer walks into a library…
pauljervisheath
211
25k
Paper Plane
katiecoart
PRO
6
55k
Git: the NoSQL Database
bkeepers
PRO
433
67k
Writing Fast Ruby
sferik
630
63k