Closed gordonbrander closed 6 months ago
Note that this PR switch to feed-forward async generators. I believe implementing cooperative generators that can communicate bi-directionally and fold with state/msg would require a considerably more complex cooperative multitasking runtime.
Further investigation has revealed that nearly all useful use-cases for generator-style effects requires communication with the messages sent to the store.
I believe doing this correctly will require something like Communicating Sequential Processes so that we can ensure we don't miss relevant messages while a saga is busy doing something else.
Closing for now.
This PR takes a different approach to store effects, using generators to implement simple feed-forward sagas.
fx
can be giving an async generator function that generates effectsEssentially effects are managed separately from state updates. The top-level
fx
generator function is typically written with a switch statement, just like the update function: