const whenTypeIs = Match.discriminator("type");
Match.value(command).pipe(
whenTypeIs("foo", (_) => doStuffA()),
whenTypeIs("bar", (_) => doStuffB()),
whenTypeIs("baz", (_) => doStuffC()),
Match.exhaustive,
);
const whenTypeIs = Match.discriminator("type");
Match.value(command).pipe(
whenTypeIs("foo", (_) => doStuffA()),
whenTypeIs("bar", (_) => doStuffB()),
whenTypeIs("baz", (_) => doStuffC()),
Match.exhaustive,
);