Skip to content

xstate@5.0.0-beta.12

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 19 May 09:04
· 478 commits to main since this release
0957861

Major Changes

  • #3990 fe6db147a Thanks @davidkpiano! - You can now add a systemId to spawned actors to reference them anywhere in the system.

    const machine = createMachine({
      // ...
      context: ({ spawn }) => ({
        actorRef: spawn(
          createMachine({
            // ...
          }),
          { systemId: 'actorRef' }
        )
      })
    });
  • #3991 98db493e4 Thanks @davidkpiano! - The actor.onDone(...) method is removed. Use actor.subscribe({ complete() {... } }) instead.

    - actor.onDone(() => { ... })
    + actor.subscribe({
    +  complete() {
    +    // ...
    +  }
    +})