Skip to content

xstate@6.0.0-alpha.9

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 26 Jun 01:20
· 0 commits to main since this release
f495fd6

Minor Changes

  • 54205cc: Export setup helper types for libraries that return or decorate setup-bound objects while preserving native setup(...).createMachine(...) typing.

    import {
      setup,
      type AnySetupConfig,
      type SetupReturnFromConfig
    } from 'xstate';
    
    function decorateSetup<const TConfig extends AnySetupConfig>(
      config: TConfig
    ): SetupReturnFromConfig<TConfig> & { extra: true } {
      const s = setup(config) as SetupReturnFromConfig<TConfig>;
    
      return Object.assign(s, { extra: true as const });
    }

Patch Changes

  • 54205cc: Empty Standard Schema event objects now infer as type-only events, so { type: 'SEND' } is accepted for an empty SEND payload schema while non-empty schemas still require their payload fields.
  • 54205cc: Registered invoke onDone callbacks now receive the invoked actor's output type, and machine.provide({ actorSources }) accepts compatible actor implementations with sound input/output variance.