A matcher that can be used in the Result match function.
@example: Here's a simple example:
const result = await try$(primeAsync());
const message = result.match(
when(Ok, (num) => `${num} is prime!`),
when(Err, (err) => `Failed to make a prime number with Error: ${err}`)
);
console.log(message);
See the Result matching for more details.
Generated using TypeDoc
Creates a matcher that will match to either
OkorErrResults.