#304018dc2b3e2 Thanks @davidkpiano! - The AnyState and AnyStateMachine types are now available, which can be used to express any state and state machine, respectively:
import type { AnyState, AnyStateMachine } from 'xstate';
// A function that takes in any state machine
function visualizeMachine(machine: AnyStateMachine) {
// (exercise left to reader)
}
function logState(state: AnyState) {
// ...
}
#3042e53396f08 Thanks @suerta-git! - Added the AnyStateConfig type, which represents any StateConfig<...>:
import type { AnyStateConfig } from 'xstate';
import { State } from 'xstate';
// Retrieving the state config from localStorage
const stateConfig: AnyStateConfig = JSON.parse(
localStorage.getItem('app-state')
);
// Use State.create() to restore state from config object with correct type
const previousState = State.create(stateConfig);
Commits
83fccd1 Merge pull request #3043 from statelyai/changeset-release/main
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps xstate from 4.30.0 to 4.30.1.
Release notes
Sourced from xstate's releases.
Commits
83fccd1
Merge pull request #3043 from statelyai/changeset-release/main3da6416
Version Packagese75c47a
Merge pull request #3050 from statelyai/andarist/patch-2ff53b1e
Remove automatic assignment of David for all bug reports85975ed
Merge pull request #3040 from statelyai/davidkpiano/any-machine673cdf6
Merge pull request #3042 from suerta-git/maine53396f
Add changeset46f1a30
Add AnyStateConfig70e2080
Fix imports9bf177a
Remove unused typesDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)