Closed jimydavis closed 1 year ago
You can access the unrouted handler from a routed handler through the embedded struct. So maybe you can do the following:
routedHandler := hooks.NewHandlerWithHooks(...)
unroutedHandler := routedHandler.UnroutedHandler
I haven't tried it yet, but if this works, we can add this as an implementation for NewUnroutedHandlerWithHooks
@Acconut I have tried and it works. Thanks for the amazingly fast reply.
There is a
NewHandlerWithHooks
in v2. Will there be aNewUnroutedHandlerWithHooks
? From looking at the code, it seems like if I start copy pasting the language insideNewHandlerWithHooks
, I will end up forking the whole repo.Thank you!