xstate
xstate copied to clipboard
[core] Synchronizers
Added support for synchronizers in XState, allowing state persistence and synchronization across different storage mechanisms.
- Introduced
Synchronizerinterface for implementing custom synchronization logic - Added
syncoption tocreateActorfor attaching synchronizers to actors
import { createActor } from 'xstate';
import { someMachine } from './someMachine';
import { createLocalStorageSync } from './localStorageSynchronizer';
const actor = createActor(someMachine, {
sync: createLocalStorageSync('someKey')
});
🦋 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