-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typed cookie id's #209
Comments
Looks good to me |
@dargmuesli The only place it is being used is in the plugin. Another workaround: https://nuxt.com/docs/guide/going-further/modules#exposing-options-to-runtime module.ts nuxt.options.runtimeConfig.cookieControl = moduleOptions plugin.ts const plugin: Plugin<{ cookies: State }> = defineNuxtPlugin((_nuxtApp) => {
console.log('moduleOptions', _nuxtApp.$config.cookieControl)
} |
Migrating to |
Sorry, was on another task. I see that you already did it - Well done. |
I didn't manage to get |
I'll take a look within the next week |
@dargmuesli Done, fixed with #213 declare module '@nuxt/schema' {
interface PublicRuntimeConfig {
cookieControl: ModuleOptions
}
} I also moved it to public runtime config. Since the plugin is being run on the client side aswell. And the line nuxt.options.runtimeConfig.public.cookieControl = moduleOptions I've placed at the bottom of the module setup, since the moduleOptions are being changed during setup. |
Describe the feature
Would be nice with having cookies typed.
I wanna know if this is wanted, before making any pr.
I am working on a composable for my project, i'd like to have some kind of selector for which cookie i am targeting with the composable.
Having the cookie id's as string literals instead of being typed as strings would catch misspelling.
It would probably not be anything major, just a new types file, a generator for this typing would be fairly small probably 10 lines.
Additional information
Final checks
The text was updated successfully, but these errors were encountered: