by athanagor2 · 4y ago · 0 comments
const input1 = yield
// arbitrary side effects, UI updates etc.
const input2 = yield
// ...
Each time the user makes an input, it is accumulated in a list, and sent back to the generator function. When the user decides to cancel the last step, a generator is recreated and rerun, with each yield sending back the user input that was stored in the list, except the last one. This requires writing the generator function in a particular way (you have to avoid setting "external" state), but it works and is more flexible than automata, I think.No comments yet.