Skip to content

@xstate/effect@0.1.0-alpha.7

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 08 Oct 04:35
· 11 commits to main since this release
8af9f65

Patch Changes

  • 902becb: createEffectActor accepts a persisted snapshot. The actor resumes in the persisted state and context without re-running entry actions, and pending delayed transitions keep their original deadlines on Effect's Clock.

    const saved = actor.getPersistedSnapshot();
    // later, possibly in another process
    const restored = yield* createEffectActor(machine, { snapshot: saved });

    State-machine children resume their persisted state, and completed children do not restart. Running Effect tasks and streams, including a root fromEffect or fromEffectStream actor, restart from the beginning, as running async and callback actors do with XState's createActor(logic, { snapshot }). A snapshot-only restore does not need input.