Skip to content

Releases: statelyai/xstate

@xstate/[email protected]

17 Apr 18:06
5376445
Compare
Choose a tag to compare

Minor Changes

Patch Changes

[email protected]

15 Apr 17:58
0c47d8c
Compare
Choose a tag to compare

Minor Changes

  • f3ff150 #1103 Thanks @davidkpiano! - Simplify the TransitionConfigArray and TransitionConfigMap types in order to fix excessively deep type instantiation TypeScript reports. This addresses #1015.

  • 6c47b66 #1076 Thanks @Andarist! - Added support for conditional actions. It's possible now to have actions executed based on conditions using following:

    entry: [
      choose([
        { cond: ctx => ctx > 100, actions: raise('TOGGLE') },
        {
          cond: 'hasMagicBottle',
          actions: [assign(ctx => ({ counter: ctx.counter + 1 }))]
        },
        { actions: ['fallbackAction'] }
      ])
    ];

    It works very similar to the if-else syntax where only the first matched condition is causing associated actions to be executed and the last ones can be unconditional (serving as a general fallback, just like else branch).

Patch Changes

  • 1a129f0 #1073 Thanks @Andarist! - Cleanup internal structures upon receiving termination events from spawned actors.

  • e88aa18 #1085 Thanks @Andarist! - Fixed an issue with data expressions of root's final nodes being called twice.

  • 88b17b2 #1090 Thanks @rjdestigter! - This change carries forward the typestate type information encoded in the arguments of the following functions and assures that the return type also has the same typestate type information:

    • Cloned state machine returned by .withConfig.
    • .state getter defined for services.
    • start method of services.
  • d5f622f #1069 Thanks @davidkpiano! - Loosened event type for SendAction<TContext, AnyEventObject>

@xstate/[email protected]

15 Apr 17:58
0c47d8c
Compare
Choose a tag to compare

Minor Changes

  • 137b0cd #1033 Thanks @ZempTime! - Added ESM build of the package which can be loaded through modern web bundlers (instead of default CommonJS files).

Patch Changes

@xstate/[email protected]

15 Apr 17:58
0c47d8c
Compare
Choose a tag to compare

Minor Changes

  • 137b0cd #1033 Thanks @ZempTime! - Added ESM build of the package which can be loaded through modern web bundlers (instead of default CommonJS files).

Patch Changes

@xstate/[email protected]

15 Apr 17:58
0c47d8c
Compare
Choose a tag to compare

Minor Changes

  • 3d50808 #1082 Thanks @davidkpiano! - The .state property is now exposed on the service returned from interpret(machine), which is a getter that returns the latest state of the machine.

Patch Changes

  • dcbd72f #1122 Thanks @chancestrickland! - StateMachine.Config type accepts now a third type parameter - TState - similarly to other existing types. When provided it provides helpful intellisense when defining the state chart transitions.

[email protected]

04 Mar 11:40
d1a9c40
Compare
Choose a tag to compare

Minor Changes

  • 55aa589 #960 Thanks @davidkpiano! - The machine can now be safely JSON-serialized, using JSON.stringify(machine). The shape of this serialization is defined in machine.schema.json and reflected in machine.definition.

    Note that onEntry and onExit have been deprecated in the definition in favor of entry and exit.

Patch Changes

[email protected]

04 Feb 13:33
b7fabd8
Compare
Choose a tag to compare

Patch Changes

@xstate/[email protected]

04 Feb 13:33
b7fabd8
Compare
Choose a tag to compare

Patch Changes

@xstate/[email protected]

28 Jan 19:01
5327a34
Compare
Choose a tag to compare

[email protected]

24 Jan 10:53
Compare
Choose a tag to compare

Patch Changes

  • c8db035 #936 Thanks @davidkpiano! - The escalate() action can now take in an expression, which will be evaluated against the context, event, and meta to return the error data.

  • 2a3fea1 #952 Thanks @davidkpiano! - The typings for the raise() action have been fixed to allow any event to be raised. This typed behavior will be refined in version 5, to limit raised events to those that the machine accepts.

  • f86d419 #957 Thanks @Andarist! - Fixed memory leak - each created service has been registered in internal map but it was never removed from it. Registration has been moved to a point where Interpreter is being started and it's deregistered when it is being stopped.