DEV Community

Discussion on: You don't need a library for state machines

aurelmegn profile image

There is a more Object oriented approach using the State design pattern. It helps to have a cleaner code (

davidkpiano profile image
David K. 🎹 Author

Right; if you want to use OOP, you can. It's basically the same thing as switch-case + functions (substitute methods for functions).