SlideShare a Scribd company logo
1 of 43
Download to read offline
DETERMINISTIC JS APPLICATIONS
State Management
A B O U T M E
{
"name": "Ilia Idakiev",
"experience": [
"Developer & Founder of HNS/HG“,
"Lecturer in 'Advanced JS' @ Sofia University”,
"Contractor / Consultant",
“Public / Private Courses“
],
"involvedIn": [
"Angular Sofia", "SofiaJS", "BeerJS"
]
}
ANGULAR SOFIA
26.01.2019 (Saturday)

10 AM – 1:30 PM

@ CampusX
“A deterministic system is a system in which no 
randomness is involved in the development of future
states of the system. A deterministic model will thus
always produce the same output from a given
starting condition or initial state.
wikipedia
“In computer programming, a pure function is a
function that:



1. Returns the same value for the same arguments.
2. Its evaluation has no side effects.
wikipedia
“An expression is called referentially transparent if
it can be replaced with its corresponding value
without changing the program's behavior. This
requires that the expression is pure.
wikipedia
Why?
BENEFITS OF WRITING REFERENTIAL TRANSPARENT CODE
• It’s easier to modify code without breaking it.

• It’s possible to apply optimisations like memoization, lazy-evaluation.

• Helps proving correctness. (It’s easier to reason about.)
Deterministic JavaScript Applications
REDUX
Deterministic JavaScript Applications
REDUX
Resource: https://itnext.io/integrating-semantic-ui-modal-with-redux-4df36abb755c
What should we put inside the REDUX store?
How to minimise our state?
Deterministic JavaScript Applications
STATE DERIVATIONS WITH SELECTORS (RESELECT)
• Selectors can compute derived data, allowing Redux to store the minimal possible
state.

• Selectors are efficient. A selector is not recomputed unless one of its arguments
changes.

• Selectors are composable. They can be used as input to other selectors.
How should we store data inside the REDUX store?
Deterministic JavaScript Applications
PROBLEMS WITH STATE SHAPE
• When a piece of data is duplicated in several places, it becomes harder to make sure that it is
updated appropriately.

• Nested data means that the corresponding reducer logic has to be more nested and therefore
more complex. In particular, trying to update a deeply nested field can become very ugly very
fast.

• Since immutable data updates require all ancestors in the state tree to be copied and updated
as well, and new object references will cause connected UI components to re-render, an
update to a deeply nested data object could force totally unrelated UI components to re-
render even if the data they're displaying hasn't actually changed.



• NORMALIZR - Normalises nested JSON according to a schema.
FIX:
Reusing reducer logic?
Deterministic JavaScript Applications
HIGH ORDER REDUCERS
• A higher-order reducer is a function that takes a reducer function as an argument,
and/or returns a new reducer function as a result. It can also be viewed as a
"reducer factory". 

• We can use this pattern to create specialized versions of our own reducer
functions, with each version only responding to specific actions.
How to make our application state persistent across browsers?
THE UNIFORM RESOURCE
LOCATOR (URL),
Deterministic JavaScript Applications
SINGLE PAGE APPLICATIONS
http://location/**/*
index.html
*
*without static assets like css, js files
Deterministic JavaScript Applications
HOW SINGLE PAGE APPLICATION NAVIGATION WORKS
• Each browser tab has a “browsing context”.

• The browsing context maintains a “session history”, which is basically, an array of
location entries
Deterministic JavaScript Applications
BROWSER HISTORY API
• pushState() - takes three parameters: a state object, a title (which is currently
ignored), and (optionally) a URL.

• replaceState() - operates exactly like pushState() except that it modifies the current
history entry instead of creating a new one.

• go() - method to load a specific page from session history, identified by its relative
position to the current page (with the current page being, of course, relative index 0).

• back() - like the back browser button.

• forward() - like the froward browser button.
Deterministic JavaScript Applications
BROWSER HISTORY API IN SPA
• <a href=“…”>Link</a> with event.preventDefault + pushState

• window.addEventListener(‘popstate’, changeRouteHandler)
Deterministic JavaScript Applications
ROUTER DYNAMIC PATTERN MATCHING
• A dynamic segment is denoted by a colon “:”
• When a route is matched, the value of the dynamic segments will be available for
use.
/user/:username/post/:post_id
Deterministic JavaScript Applications
UNIFORM RESOURCE LOCATOR
• a form of URI and a standardized naming convention for addressing documents
accessible over the Internet and Intranet.
Resource: https://medium.com/@pshrmn/demystifying-single-page-applications-3068d0555d46
Deterministic JavaScript Applications
UTILISING THE URL IN SINGLE PAGE APPLICATIONS
• Controlling UI components like Dialogs and Tabs using the URL path.

• Controlling the data and state of UI element like tables, dropdown.
• Application State Persistence
• Reducing Redux State
• More Deterministic Application
• Writing less code?
PROS CONS
• Longer and uglier URL
Deterministic JavaScript Applications
WHAT ARE WE TRYING TO ACHIEVE?
APPLICATION OUTPUTINPUT
(Pure function)
How will this work without side-effects?
Deterministic JavaScript Applications
SIDE EFFECTS
• Side effects are essential to enable a program to work with the outside world
(people, filesystems, networks).

• By abstracting the side-effects it’s easier for us to find and fix errors.



DEMO
Is REDUX enough?
After a while its very hard to follow
how and why state changes
happened when the state starts
growing bigger and bigger
“A finite-state machine (FSM) is an abstract
machine that can be in exactly one of a finite number
of states at any given time.
wikipedia
Deterministic JavaScript Applications
FINITE-STATE MACHINES
➤ Can change from one state to another in response to some external input.

➤ Are defined by a list of its states, its initial state, and the conditions for each state
transition.

➤ Can be of two types - deterministic and non-deterministic (but every non-
deterministic can be converted to deterministic)
Deterministic JavaScript Applications
DETERMINISTIC FINITE-STATE MACHINES
➤ each of its transitions is uniquely determined by its source state and input
symbol, and
➤ reading an input symbol is required for each state transition.
In automata theory, a finite state machine is called a deterministic finite
automaton (DFA), if
Deterministic JavaScript Applications
DETERMINISTIC FINITE-STATE MACHINES
a b c
STATECHARTS
Deterministic JavaScript Applications
STATECHARTS
➤ Extended state machine diagrams that allow us to model our states hierarchically.

➤ A compound state can be split up into completely separate orthogonal regions and
each region specifies its own state machine.

➤ States can have multiple transitions for the same event and transitions can be
guarded.

➤ Transitions can happen automatically and can be delayed.

➤ Statecharts keep history.
Resource: https://statecharts.github.io/
XSTATE
DEMO
Deterministic JavaScript Applications
XSTATE
➤ We can preview and simulate your statecharts with xstate visualizer.

➤ Eeasy to test all cases that our application can be in.
Resource: https://statecharts.github.io/
GitHub > https://github.com/iliaidakiev (/slides/ - list of future and past events)
Twitter > @ilia_idakiev
STATECHARTS
Deterministic JavaScript Applications
CONNECT
THANK YOU!

More Related Content

Similar to Deterministic JavaScript Applications

CTS2 Development Framework In Action
CTS2 Development Framework In ActionCTS2 Development Framework In Action
CTS2 Development Framework In Action
cts2framework
 
Java Web services
Java Web servicesJava Web services
Java Web services
Sujit Kumar
 

Similar to Deterministic JavaScript Applications (20)

States, state graphs and transition testing
States, state graphs and transition testingStates, state graphs and transition testing
States, state graphs and transition testing
 
Potter’S Wheel
Potter’S WheelPotter’S Wheel
Potter’S Wheel
 
Continuous Intelligence - Streaming Apps That Are Always In Sync | Simon Cros...
Continuous Intelligence - Streaming Apps That Are Always In Sync | Simon Cros...Continuous Intelligence - Streaming Apps That Are Always In Sync | Simon Cros...
Continuous Intelligence - Streaming Apps That Are Always In Sync | Simon Cros...
 
CTS2 Development Framework In Action
CTS2 Development Framework In ActionCTS2 Development Framework In Action
CTS2 Development Framework In Action
 
Advanced web application architecture Way2Web
Advanced web application architecture Way2WebAdvanced web application architecture Way2Web
Advanced web application architecture Way2Web
 
The Clean Architecture
The Clean ArchitectureThe Clean Architecture
The Clean Architecture
 
Liftweb
LiftwebLiftweb
Liftweb
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
How to – wrap soap web service around a database
How to – wrap soap web service around a databaseHow to – wrap soap web service around a database
How to – wrap soap web service around a database
 
A load balancing model based on cloud partitioning for the public cloud. ppt
A  load balancing model based on cloud partitioning for the public cloud. ppt A  load balancing model based on cloud partitioning for the public cloud. ppt
A load balancing model based on cloud partitioning for the public cloud. ppt
 
Software engineering rogers pressman chapter 7
Software engineering rogers pressman chapter 7Software engineering rogers pressman chapter 7
Software engineering rogers pressman chapter 7
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
Hybrid Web Applications
Hybrid Web ApplicationsHybrid Web Applications
Hybrid Web Applications
 
Data Con LA 2022 - Event Sourcing with Apache Pulsar and Apache Quarkus
Data Con LA 2022 - Event Sourcing with Apache Pulsar and Apache QuarkusData Con LA 2022 - Event Sourcing with Apache Pulsar and Apache Quarkus
Data Con LA 2022 - Event Sourcing with Apache Pulsar and Apache Quarkus
 
Java Web services
Java Web servicesJava Web services
Java Web services
 
Taming the QIX Engine with Reactive Programming
Taming the QIX Engine with Reactive ProgrammingTaming the QIX Engine with Reactive Programming
Taming the QIX Engine with Reactive Programming
 
Automate Software Change Estimation
Automate Software Change EstimationAutomate Software Change Estimation
Automate Software Change Estimation
 
Antelope: A Web service for publishing Life Cycle Assessment models and resul...
Antelope: A Web service for publishing Life Cycle Assessment models and resul...Antelope: A Web service for publishing Life Cycle Assessment models and resul...
Antelope: A Web service for publishing Life Cycle Assessment models and resul...
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6
 
Full Stack Reactive In Practice
Full Stack Reactive In PracticeFull Stack Reactive In Practice
Full Stack Reactive In Practice
 

More from Ilia Idakiev

More from Ilia Idakiev (18)

No more promises lets RxJS 2 Edit
No more promises lets RxJS 2 EditNo more promises lets RxJS 2 Edit
No more promises lets RxJS 2 Edit
 
Enterprise State Management with NGRX/platform
Enterprise State Management with NGRX/platformEnterprise State Management with NGRX/platform
Enterprise State Management with NGRX/platform
 
Deep Dive into Zone.JS
Deep Dive into Zone.JSDeep Dive into Zone.JS
Deep Dive into Zone.JS
 
RxJS Schedulers - Controlling Time
RxJS Schedulers - Controlling TimeRxJS Schedulers - Controlling Time
RxJS Schedulers - Controlling Time
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
 
No More Promises! Let's RxJS!
No More Promises! Let's RxJS!No More Promises! Let's RxJS!
No More Promises! Let's RxJS!
 
Marble Testing RxJS streams
Marble Testing RxJS streamsMarble Testing RxJS streams
Marble Testing RxJS streams
 
Web Components Everywhere
Web Components EverywhereWeb Components Everywhere
Web Components Everywhere
 
Building Reusable Custom Elements With Angular
Building Reusable Custom Elements With AngularBuilding Reusable Custom Elements With Angular
Building Reusable Custom Elements With Angular
 
State management for enterprise angular applications
State management for enterprise angular applicationsState management for enterprise angular applications
State management for enterprise angular applications
 
Offline progressive web apps with NodeJS and React
Offline progressive web apps with NodeJS and ReactOffline progressive web apps with NodeJS and React
Offline progressive web apps with NodeJS and React
 
Testing rx js using marbles within angular
Testing rx js using marbles within angularTesting rx js using marbles within angular
Testing rx js using marbles within angular
 
Predictable reactive state management for enterprise apps using NGRX/platform
Predictable reactive state management for enterprise apps using NGRX/platformPredictable reactive state management for enterprise apps using NGRX/platform
Predictable reactive state management for enterprise apps using NGRX/platform
 
Angular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of SpeedAngular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of Speed
 
Angular Offline Progressive Web Apps With NodeJS
Angular Offline Progressive Web Apps With NodeJSAngular Offline Progressive Web Apps With NodeJS
Angular Offline Progressive Web Apps With NodeJS
 
Introduction to Offline Progressive Web Applications
Introduction to Offline Progressive Web ApplicationsIntroduction to Offline Progressive Web Applications
Introduction to Offline Progressive Web Applications
 
Reflective injection using TypeScript
Reflective injection using TypeScriptReflective injection using TypeScript
Reflective injection using TypeScript
 
Zone.js
Zone.jsZone.js
Zone.js
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Deterministic JavaScript Applications

  • 2. A B O U T M E { "name": "Ilia Idakiev", "experience": [ "Developer & Founder of HNS/HG“, "Lecturer in 'Advanced JS' @ Sofia University”, "Contractor / Consultant", “Public / Private Courses“ ], "involvedIn": [ "Angular Sofia", "SofiaJS", "BeerJS" ] }
  • 4. 26.01.2019 (Saturday)
 10 AM – 1:30 PM
 @ CampusX
  • 5. “A deterministic system is a system in which no  randomness is involved in the development of future states of the system. A deterministic model will thus always produce the same output from a given starting condition or initial state. wikipedia
  • 6. “In computer programming, a pure function is a function that:
 
 1. Returns the same value for the same arguments. 2. Its evaluation has no side effects. wikipedia
  • 7. “An expression is called referentially transparent if it can be replaced with its corresponding value without changing the program's behavior. This requires that the expression is pure. wikipedia
  • 9. BENEFITS OF WRITING REFERENTIAL TRANSPARENT CODE • It’s easier to modify code without breaking it.
 • It’s possible to apply optimisations like memoization, lazy-evaluation.
 • Helps proving correctness. (It’s easier to reason about.) Deterministic JavaScript Applications
  • 10. REDUX
  • 11. Deterministic JavaScript Applications REDUX Resource: https://itnext.io/integrating-semantic-ui-modal-with-redux-4df36abb755c
  • 12. What should we put inside the REDUX store?
  • 13. How to minimise our state?
  • 14. Deterministic JavaScript Applications STATE DERIVATIONS WITH SELECTORS (RESELECT) • Selectors can compute derived data, allowing Redux to store the minimal possible state.
 • Selectors are efficient. A selector is not recomputed unless one of its arguments changes.
 • Selectors are composable. They can be used as input to other selectors.
  • 15. How should we store data inside the REDUX store?
  • 16. Deterministic JavaScript Applications PROBLEMS WITH STATE SHAPE • When a piece of data is duplicated in several places, it becomes harder to make sure that it is updated appropriately.
 • Nested data means that the corresponding reducer logic has to be more nested and therefore more complex. In particular, trying to update a deeply nested field can become very ugly very fast.
 • Since immutable data updates require all ancestors in the state tree to be copied and updated as well, and new object references will cause connected UI components to re-render, an update to a deeply nested data object could force totally unrelated UI components to re- render even if the data they're displaying hasn't actually changed.
 
 • NORMALIZR - Normalises nested JSON according to a schema. FIX:
  • 18. Deterministic JavaScript Applications HIGH ORDER REDUCERS • A higher-order reducer is a function that takes a reducer function as an argument, and/or returns a new reducer function as a result. It can also be viewed as a "reducer factory". 
 • We can use this pattern to create specialized versions of our own reducer functions, with each version only responding to specific actions.
  • 19. How to make our application state persistent across browsers?
  • 21. Deterministic JavaScript Applications SINGLE PAGE APPLICATIONS http://location/**/* index.html * *without static assets like css, js files
  • 22. Deterministic JavaScript Applications HOW SINGLE PAGE APPLICATION NAVIGATION WORKS • Each browser tab has a “browsing context”.
 • The browsing context maintains a “session history”, which is basically, an array of location entries
  • 23. Deterministic JavaScript Applications BROWSER HISTORY API • pushState() - takes three parameters: a state object, a title (which is currently ignored), and (optionally) a URL.
 • replaceState() - operates exactly like pushState() except that it modifies the current history entry instead of creating a new one.
 • go() - method to load a specific page from session history, identified by its relative position to the current page (with the current page being, of course, relative index 0).
 • back() - like the back browser button.
 • forward() - like the froward browser button.
  • 24. Deterministic JavaScript Applications BROWSER HISTORY API IN SPA • <a href=“…”>Link</a> with event.preventDefault + pushState
 • window.addEventListener(‘popstate’, changeRouteHandler)
  • 25. Deterministic JavaScript Applications ROUTER DYNAMIC PATTERN MATCHING • A dynamic segment is denoted by a colon “:” • When a route is matched, the value of the dynamic segments will be available for use. /user/:username/post/:post_id
  • 26. Deterministic JavaScript Applications UNIFORM RESOURCE LOCATOR • a form of URI and a standardized naming convention for addressing documents accessible over the Internet and Intranet. Resource: https://medium.com/@pshrmn/demystifying-single-page-applications-3068d0555d46
  • 27. Deterministic JavaScript Applications UTILISING THE URL IN SINGLE PAGE APPLICATIONS • Controlling UI components like Dialogs and Tabs using the URL path.
 • Controlling the data and state of UI element like tables, dropdown. • Application State Persistence • Reducing Redux State • More Deterministic Application • Writing less code? PROS CONS • Longer and uglier URL
  • 28. Deterministic JavaScript Applications WHAT ARE WE TRYING TO ACHIEVE? APPLICATION OUTPUTINPUT (Pure function)
  • 29. How will this work without side-effects?
  • 30. Deterministic JavaScript Applications SIDE EFFECTS • Side effects are essential to enable a program to work with the outside world (people, filesystems, networks).
 • By abstracting the side-effects it’s easier for us to find and fix errors.
 

  • 31. DEMO
  • 32. Is REDUX enough? After a while its very hard to follow how and why state changes happened when the state starts growing bigger and bigger
  • 33. “A finite-state machine (FSM) is an abstract machine that can be in exactly one of a finite number of states at any given time. wikipedia
  • 34. Deterministic JavaScript Applications FINITE-STATE MACHINES ➤ Can change from one state to another in response to some external input.
 ➤ Are defined by a list of its states, its initial state, and the conditions for each state transition.
 ➤ Can be of two types - deterministic and non-deterministic (but every non- deterministic can be converted to deterministic)
  • 35. Deterministic JavaScript Applications DETERMINISTIC FINITE-STATE MACHINES ➤ each of its transitions is uniquely determined by its source state and input symbol, and ➤ reading an input symbol is required for each state transition. In automata theory, a finite state machine is called a deterministic finite automaton (DFA), if
  • 38. Deterministic JavaScript Applications STATECHARTS ➤ Extended state machine diagrams that allow us to model our states hierarchically.
 ➤ A compound state can be split up into completely separate orthogonal regions and each region specifies its own state machine.
 ➤ States can have multiple transitions for the same event and transitions can be guarded.
 ➤ Transitions can happen automatically and can be delayed.
 ➤ Statecharts keep history. Resource: https://statecharts.github.io/
  • 40. DEMO
  • 41. Deterministic JavaScript Applications XSTATE ➤ We can preview and simulate your statecharts with xstate visualizer.
 ➤ Eeasy to test all cases that our application can be in. Resource: https://statecharts.github.io/
  • 42. GitHub > https://github.com/iliaidakiev (/slides/ - list of future and past events) Twitter > @ilia_idakiev STATECHARTS Deterministic JavaScript Applications CONNECT