0

Is there any way to pass machine options such as "guards" and "delays" to a spawned machine either through the "spawn" function on the parent machine or the "useActor" hook on the context property?

DiniMad
  • 49
  • 1
  • 9

1 Answers1

1

After a while, I find out about the "withConfig" method on the machine. You can use it like this.

assign({
            machine: () => spawn(someMachine.withConfig({
                guards: {
                  //...
                },
            })),
        })
DiniMad
  • 49
  • 1
  • 9