github statelyai/xstate xstate@5.10.0

20 days ago

Minor Changes

  • #4822 f7f1fbbf3 Thanks @davidkpiano! - The clock and logger specified in the options object of createActor(logic, options) will now propagate to all actors created within the same actor system.

    import { setup, log, createActor } from 'xstate';
    
    const childMachine = setup({
      // ...
    }).createMachine({
      // ...
      // Uses custom logger from root actor
      entry: log('something')
    });
    
    const parentMachine = setup({
      // ...
    }).createMachine({
      // ...
      invoke: {
        src: childMachine
      }
    });
    
    const actor = createActor(parentMachine, {
      logger: (...args) => {
        // custom logger for args
      }
    });
    
    actor.start();

Don't miss a new xstate release

NewReleases is sending notifications on new releases.