Kyle Shevlin 5/15/2020

Adding Infinite States to a `useReducer` Finite State Machine

Read Original

This technical article builds on a previous post about using React's useReducer as a finite state machine. It explains how to extend the machine to store and manage infinite contextual data (like user input values) alongside finite states, preparing for future features like guards and conditions. The post includes code examples modifying a LightBulb component's reducer to handle event objects with associated data.

Adding Infinite States to a `useReducer` Finite State Machine

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week