overriding Route type when initializing UniversalRouter
See original GitHub issueI’m submitting a …
- bug report
- feature request
- other (Please do not submit support requests here (below))
I’m having trouble overriding Route type when initializing UniversalRouter:
interface MyRouteType {
customProperty: any;
}
const router = new UniversalRouter<MyContextType, MyRouteType>(routes, {
async resolveRoute(context, params) {
if (context.route.customProperty) {
console.log(context.route.customProperty);
}
},
});
My IDE is complaining that customProperty doesn’t exist on context.route
I fixed it like this: http://www.mergely.com/oC2xyDZh/, but I’m still new to typescript and I’m not sure if my fix is any good.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Configuring IPv4 Static and Default Routes (Solution) Topology
Step 1: Cable the network as shown in the topology. Step 2: Initialize and reload the router and switch. Part 2: Configure Basic...
Read more >How to Advertise a Default Route - CBT Nuggets
Default routes ensure things get to where they need to be despite all the different networks and devices out there. Learn how default...
Read more >Can't reload/refresh active route - angular - Stack Overflow
The first thing you will need to do is set the option within your app.routing.ts if you have one or the file where...
Read more >Basic BGP Routing Policies | Junos OS - Juniper Networks
Each routing policy is identified by a policy name. The name can contain letters, numbers, and hyphens (-) and can be up to...
Read more >Universal Routing 8.1 Deployment Guide
Warm Standby means that a backup application server is initialized and ready ... External Routing Point and a route type of Overwrite DNIS....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Have you tried to add a
universal-router.d.ts
in your project source root with the following content?Just found an article: TypeScript: Adding Custom Type Definitions for Existing Libraries
Also I will try to find time next week to update PR #183 and release v9, but it is not guaranteed 🤷♂️
Awesome! thank you @frenzzy 😃