Closed rjdestigter closed 2 years ago
This allows usage of async in combination with void effects. E.g.:
useStateMachine({ initial: "downloading", states: { idle: { on: { DOWNLOAD: "downloading", }, }, downloading: { on: { OK: "idle", }, async effect({ setContext }) { await Promise.resolve(42) setContext({..}).send(..) }, }, }, });
Just saw your codesandbox example. I think I might like that better actually.
This allows usage of async in combination with void effects. E.g.: