Routers may be used for side effects or for computing values. In either case,
a Result type may be provided. When provided, the router will ensure that
handlers' return values match the provided Result type. Otherwise, handlers
will be allowed to return any type of data; the router's .dispatch() method
will then indicate all of the possible types that could be returned.
Construct a router.
Routers may be used for side effects or for computing values. In either case, a
Resulttype may be provided. When provided, the router will ensure that handlers' return values match the providedResulttype. Otherwise, handlers will be allowed to return any type of data; the router's.dispatch()method will then indicate all of the possible types that could be returned.