github statelyai/xstate @xstate/store@2.6.0

latest releases: @xstate/vue@4.0.0, @xstate/store@2.6.1, @xstate/svelte@4.0.0...
one month 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.