Skip to content

@xstate/svelte@6.0.0-beta.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 05 Nov 20:28
· 2 commits to main since this release
4829a7b

Minor Changes

  • 81dd3dd: useActorRef, useActor and useMachine accept an already-created actor, such as one from restoreActor. The snapshot option is removed; restore the actor with restoreActor from xstate/persist and pass it to the hook. The hook starts the actor and stops it when the component is destroyed, as it does for actors it creates. Create the actor once per component instance.

    <script lang="ts">
      import { useActor } from '@xstate/svelte';
      import { restoreActor } from 'xstate/persist';
    
      const { snapshot, send } = useActor(restoreActor(machine, persisted));
    </script>

Patch Changes

  • 6cf6982: XState v6 enters beta. No further breaking changes are planned for APIs tagged @public; any that are needed will be called out with a migration path. APIs tagged @experimental may still change.