xstate-viz
xstate-viz copied to clipboard
Refactor notification events to use notifModel
send(
notifModel.events.BROADCAST(
'An error occurred when saving.',
'error',
),
{
to: (ctx) => {
return ctx.notifRef!;
},
},
),
This is the new preferred pattern. The old pattern is:
send(
(_, e: any) => ({
type: 'BROADCAST',
status: 'error',
message: e.data.toString(),
}),
{ to: (ctx: any) => ctx.notifRef },
)