Skip to content

xstate@5.0.0-beta.19

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 25 Jul 15:08
· 421 commits to main since this release
4df5744

Major Changes

  • #4049 afc690046 Thanks @davidkpiano! - If context types are specified in the machine config, the context property will now be required:

    // ❌ TS error
    createMachine({
      types: {} as {
        context: { count: number };
      }
      // Missing context property
    });
    
    // ✅ OK
    createMachine({
      types: {} as {
        context: { count: number };
      },
      context: {
        count: 0
      }
    });

Minor Changes

  • #4117 c7c3cb459 Thanks @davidkpiano! - Actor logic creators now have access to self:

    const promiseLogic = fromPromise(({ self }) => { ... });
    
    const observableLogic = fromObservable(({ self }) => { ... });
    
    const callbackLogic = fromCallback((sendBack, receive, { self }) => { ... });
    
    const transitionLogic = fromTransition((state, event, { self }) => { ... }, ...);