github statelyai/xstate @xstate/fsm@1.3.0

4 years ago

Minor Changes

  • 7367de2 #946 Thanks @Andarist! - Added a second, optional, options parameter to the createMachine. Currently only actions map can be put there - similarly how this can be done for xstate itself:

    Example
    const machine = createMachine({
      initial: 'idle'
      states: {
        idle: {
          on: {
            LOAD: {
              target: 'loading',
              actions: 'fetchData'
            }
          }
        },
        loading: {
          // ...
        }
      }
    }, {
      actions: {
        fetchData: () => /* ... */
      }
    })
  • 3c10215 #811 Thanks @ghengeveld! - A config property got exposed on created machines. It's the same object which got passed in as argument.

Patch Changes

  • a337473 #827 Thanks @Andarist! - Fixed entry actions defined on an initial state not being executed.

Don't miss a new xstate release

NewReleases is sending notifications on new releases.