Skip to content

@xstate/store@5.0.0-alpha.5

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 30 Sep 20:56
· 9 commits to main since this release
ebe111a

Major Changes

  • c27b509: fromStore() now returns XState v6 actor logic and requires xstate@6. xstate is declared as an optional peer dependency; it is only needed if you use fromStore(). Use @xstate/store@4 with XState v5.

    import { createActor } from 'xstate';
    import { fromStore } from '@xstate/store';
    
    const logic = fromStore({ context: { count: 0 }, on: { inc: (ctx) => ({ count: ctx.count + 1 }) } });
    const actor = createActor(logic).start();
    actor.send({ type: 'inc' });