Per group hooks
#8007
Replies: 3 comments
-
This is personally a better approach than |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Working on my own implementation, but it would be easier if #8221 was approved |
Beta Was this translation helpful? Give feedback.
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
Beta Was this translation helpful? Give feedback.
All reactions