Per group hooks
#8007
Replies: 3 comments
|
This is personally a better approach than |
0 replies
|
My use case is that I want to add some "expensive" resources to my E.g. export const handle = async ({event, resolve}) => {
if (event.route.id.startsWith('/(app)/')) {
event.locals.kafkaClient = await createKafkaClient('...')
event.locals.statsDClient = await createStatsDClient('...')
// ...
}
const response = await resolve(event)
return response
}Could also be helpful for not running hooks for routes that need to be pre-rendered but don't need to run |
0 replies
|
Working on my own implementation, but it would be easier if #8221 was approved |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The problem this would solve is when I have an api group separate from everything else
This is what I originally tried:
But this is what I want to happen:
So my proposal is a +hooks.sever.ts file
All reactions