xstate icon indicating copy to clipboard operation
xstate copied to clipboard

[core] Synchronizers

Open davidkpiano opened this issue 1 year ago • 1 comments

Added support for synchronizers in XState, allowing state persistence and synchronization across different storage mechanisms.

  • Introduced Synchronizer interface for implementing custom synchronization logic
  • Added sync option to createActor for attaching synchronizers to actors
import { createActor } from 'xstate';
import { someMachine } from './someMachine';
import { createLocalStorageSync } from './localStorageSynchronizer';

const actor = createActor(someMachine, {
  sync: createLocalStorageSync('someKey')
});

davidkpiano avatar Sep 12 '24 14:09 davidkpiano

🦋 Changeset detected

Latest commit: 03854c382ecf76ac79a86f91543701502c38d22b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
xstate Minor
@xstate/graph Major
@xstate/react Major
@xstate/solid Major
@xstate/svelte Major
@xstate/vue Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Sep 12 '24 14:09 changeset-bot[bot]