Relay.
Accepts handlers for each option and returns the result from the matched handler. Three usage patterns are supported:
R
R | undefined
The options type defining all possible option variants
Handles all options with complete handlers.
The return type of all handlers
Mapping of all option keys to their handlers
The result from the matched handler
Handles some options without a fallback.
Partial mapping of option keys to handlers
The result from the matched handler, or undefined if no handler matched
undefined
Handles some options with a fallback handler for unmatched options.
Handler for options without an entry in handlers, receiving the matched option value
handlers
The result from the matched handler or fallback
Relay.
Accepts handlers for each option and returns the result from the matched handler. Three usage patterns are supported:
RR | undefinedR