github statelyai/xstate @xstate/store@2.3.0

latest releases: @xstate/solid@0.2.3, @xstate/svelte@3.0.5, @xstate/vue@3.1.4...
2 months ago

Minor Changes

  • #5056 8c35da9a72 Thanks @steveadams! - You can now use the xstate/store package with SolidJS.

    Import useSelector from @xstate/store/solid. Select the data you want via useSelector(…) and send events using store.send(eventObject):

    import { donutStore } from './donutStore.ts';
    import { useSelector } from '@xstate/store/solid';
    
    function DonutCounter() {
      const donutCount = useSelector(donutStore, (state) => state.context.donuts);
    
      return (
        <div>
          <button onClick={() => donutStore.send({ type: 'addDonut' })}>
            Add donut ({donutCount()})
          </button>
        </div>
      );
    }

Don't miss a new xstate release

NewReleases is sending notifications on new releases.