Understanding the `match` Functionality
Hello, I don't quite understand how
I want all possible branches to be executed, don't stop on first match
match works.I want all possible branches to be executed, don't stop on first match
matchimport { Match } from "effect"
const a = {
message: {
foo: "bar",
baz: 1
}
}
const main = () =>
Match.value(a).pipe(
Match.whenAnd(
{ message: { foo: "bar" } },
() => console.log("bar")
),
Match.when(
{ message: { baz: 1 } },
() => console.log("baz")
),
Match.orElse(() => console.log("orElse"))
)
main()