Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages #2217

Merged
merged 1 commit into from
Jun 1, 2021
Merged

Version Packages #2217

merged 1 commit into from
Jun 1, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented May 20, 2021

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

xstate@4.20.0

Minor Changes

  • 28059b9f #2197 Thanks @davidkpiano! - All spawned and invoked actors now have a .getSnapshot() method, which allows you to retrieve the latest value emitted from that actor. That value may be undefined if no value has been emitted yet.

    const machine = createMachine({
      context: {
        promiseRef: null
      },
      initial: 'pending',
      states: {
        pending: {
          entry: assign({
            promiseRef: () => spawn(fetch(/* ... */), 'some-promise')
          })
        }
      }
    });
    
    const service = interpret(machine)
      .onTransition(state => {
        // Read promise value synchronously
        const resolvedValue = state.context.promiseRef?.getSnapshot();
        // => undefined (if promise not resolved yet)
        // => { ... } (resolved data)
      })
      .start();
    
    // ...

Patch Changes

  • 4ef03465 #2240 Thanks @VanTanev! - Preserve StateMachine type when .withConfig() and .withContext() modifiers are used on a machine.

@xstate/react@1.3.4

Patch Changes

  • aa3c2991 #2223 Thanks @davidkpiano! - Support for actor refs with the .getSnapshot() method (added for spawned actors in XState version 4.19) is now supported in the useActor(...) hook.

@github-actions github-actions bot force-pushed the changeset-release/main branch 10 times, most recently from a82effe to 05c83ed Compare May 26, 2021 15:45
@github-actions github-actions bot force-pushed the changeset-release/main branch 2 times, most recently from 06ce9e4 to c1d20ec Compare May 29, 2021 14:22
@Andarist Andarist merged commit d4b0419 into main Jun 1, 2021
@Andarist Andarist deleted the changeset-release/main branch June 1, 2021 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant