Releases: statelyai/xstate
[email protected]
Patch Changes
-
#5139
bf6119a7310a878afbf4f5b01f5e24288f9a0f16
Thanks @SandroMaglione! - Makespawn
input required when defined inside referenced actor:const childMachine = createMachine({ types: { input: {} as { value: number } } }); const machine = createMachine({ types: {} as { context: { ref: ActorRefFrom<typeof childMachine> } }, context: ({ spawn }) => ({ ref: spawn( childMachine, // Input is now required! { input: { value: 42 } } ) }) });
@xstate/[email protected]
Patch Changes
- Updated dependencies [
bf6119a7310a878afbf4f5b01f5e24288f9a0f16
]:
@xstate/[email protected]
Patch Changes
- Updated dependencies [
bf6119a7310a878afbf4f5b01f5e24288f9a0f16
]:
@xstate/[email protected]
Patch Changes
- Updated dependencies [
bf6119a7310a878afbf4f5b01f5e24288f9a0f16
]:
@xstate/[email protected]
Patch Changes
- Updated dependencies [
bf6119a7310a878afbf4f5b01f5e24288f9a0f16
]:
@xstate/[email protected]
Patch Changes
- Updated dependencies [
bf6119a7310a878afbf4f5b01f5e24288f9a0f16
]:
@xstate/[email protected]
Patch Changes
- #5131
55ffd698419ea7259506bb0fa4bba9c7f592823e
Thanks @lendle! - Add Svelte 5 to the allowed peer dependency range
@xstate/[email protected]
Patch Changes
- #5136
c051ff7ce7d09729ccc0630d684ef5168815f507
Thanks @Andarist! - Fixed an accidental used reference ofxstate
types
[email protected]
Minor Changes
-
#4954
8c4b70652acaef2702f32435362e4755679a516d
Thanks @davidkpiano! - Added a newtransition
function that takes an actor logic, a snapshot, and an event, and returns a tuple containing the next snapshot and the actions to execute. This function is a pure function and does not execute the actions itself. It can be used like this:import { transition } from 'xstate'; const [nextState, actions] = transition(actorLogic, currentState, event); // Execute actions as needed
Added a new
initialTransition
function that takes an actor logic and an optional input, and returns a tuple containing the initial snapshot and the actions to execute from the initial transition. This function is also a pure function and does not execute the actions itself. It can be used like this:import { initialTransition } from 'xstate'; const [initialState, actions] = initialTransition(actorLogic, input); // Execute actions as needed
These new functions provide a way to separate the calculation of the next snapshot and actions from the execution of those actions, allowing for more control and flexibility in the transition process.
@xstate/[email protected]
Patch Changes
- Updated dependencies [
8c4b70652acaef2702f32435362e4755679a516d
]: