1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Create a State Machine with a Generator

    javascriptJavaScript

    Since generators can take initial values and expose a next method which can run updates on the initial value, it becomes trivial to make a state machine with a generator where you pass your transitions into the next method. This lesson walks through creating a state machine with a generator.