DRAFT: adds flow options to basic Router, as well as custom option/object passthrough #212
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This adds support for passthrough options (e.g.
port
in a Bun service), as well as the following specific options:after
: what you would pass to a.then()
chain on therouter.handle/router.fetch
.errors
: what you would pass to a catch block. if not defined, Router will still throw (uncaught).Adds appx. 45 bytes.
Considerations
The bulk of the bytes added is to support the explicit try/catch block (and rethrow). If we did not support errors in this, it would be closer to 460 bytes total (instead of 490).
Example Usage
Type of Change (select one and follow subtasks)