github statelyai/xstate @xstate/store@2.6.0

latest releases: @xstate/svelte@3.0.5, @xstate/vue@3.1.4
3 hours ago

Minor Changes

  • #5079 25963966c394fc904dc9b701a420b6e204ebe7f7 Thanks @davidkpiano! - The createStoreWithProducer(…) function now uses the new configuration API:

    import { createStoreWithProducer } from '@xstate/store';
    // DEPRECATED API
    // const store = createStoreWithProducer(
    //   producer,
    //   {
    //     count: 0
    //   },
    //   {
    //     inc: (context, event) => {
    //       context.count++;
    //     }
    //   }
    // );
    
    const store = createStoreWithProducer(producer, {
      context: {
        count: 0
      },
      on: {
        inc: (context, event) => {
          context.count++;
        }
      }
    });

Don't miss a new xstate release

NewReleases is sending notifications on new releases.