As the "autoForward" feature is no longer supported by the xState V5, I would appreciate some advice for my migration to the v5.
I have an actor whose responsibility is to wait for an "addContainer"-event and consequently spawn several child actors.
I would like every event sent to the parent actor to be automatically forwarded to all the spawned child actors.
So far, in v4, I have been executing the following action once the "addContainer"-event was received:
assign({containerRefList: (context, event) => {
const smActors = event.data;
const newActors = smActors.map((actor)=> { return spawn(actor.machine, {name: actor.id, autoForward: true})});
return [...context.containerRefList, ...newActors];
}})
In v5, how can I create the parent actor such that its received events are always sent to the actors saved in the containerRefList-context variable?