NuxtN
Nuxt2y ago
cosbgn

Is there an easy way to get `event`?

I use drizzle and cloudflare so I have an util like this one:

export const useDb = (event) => drizzle(event.context.cloudflare.env.DB, { schema }) 


My issue is that I need always event and it's annoying to pass it around betwen functions. I know there is useEvent() but it requires an experimental asyncContext which is not available on cloudflare.

How is everyone solving this?
Was this page helpful?