github statelyai/xstate xstate@5.0.0-beta.19

latest releases: @xstate/svelte@3.0.5, @xstate/vue@3.1.4, @xstate/store@2.6.0...
pre-release14 months ago

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 }) => { ... }, ...);

Don't miss a new xstate release

NewReleases is sending notifications on new releases.