github statelyai/xstate @xstate/react@1.0.2

latest releases: @xstate/svelte@3.0.5, @xstate/vue@3.1.4, @xstate/store@2.6.0...
3 years ago

Patch Changes

  • c7927083 #1516 Thanks @davidkpiano! - The send function returned from the useService() now can take two arguments (an event type and payload), to match the behavior of @xstate/react version 0.x.

  • db77623a #1516 Thanks @davidkpiano! - The send value returned from the useService() hook will now accept a payload, which matches the signature of the send value returned from the useMachine() hook:

    const [state, send] = useService(someService);
    
    // ...
    
    // this is OK:
    send('ADD', { value: 3 });
    
    // which is equivalent to:
    send({ type: 'ADD', value: 3 });
  • 93f6db02 #1594 Thanks @Andarist! - Fixed an issue with internal setState in useService being called with 2 arguments instead of 1.

  • 72b0880e #1504 Thanks @Andarist! - Fixed issue with useService returning an initial state for services in their final states.

Don't miss a new xstate release

NewReleases is sending notifications on new releases.