how to create a function that can be called from the router?
how to create a function that can be called from the router?
At a glance
The community member is trying to segment their code into smaller functions, but is having trouble because the type is not recognized. Another community member suggests that if the code is meant to be a route handler, it needs to have the type that is used with router.addHandler(routeName, handler). The original poster responds that they have a route handler and want to call a function from within it, in order to break down the code into smaller functions instead of keeping everything in the route handler. They mention they will share a code snippet soon and continue the discussion in the new year.
Can you share more code or description of what you are trying to do? If you want to add it as a route handler, it has to have the type that is use with router.addHandler(routeName, handler)
Hi Lukas. Sorry for the slow reply, I did not get a notification. I have a route handler and from within that I want to call my function, which is what I am having trouble with in order to break down the code into functions rather than placing everything in the route handler. I will share a code snippet soon. Let us discuss this in the new year until then have a nice Christmas π