Skip to content

Commit

Permalink
fix: "Fixed" types incompatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Byloth committed Feb 8, 2024
1 parent 8eab6c0 commit dd5776f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
21 changes: 9 additions & 12 deletions packages/core/src/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,17 @@ const _getActiveVuert = (): Vuert | undefined =>
};

export type PluginOptions = Partial<VuertOptions>;
export const createVuert = (options?: PluginOptions): Plugin =>
{
return {
install: ({ config, provide }: App): void =>
{
const $vuert = new Vuert(options);
export const createVuert = (options?: PluginOptions): Plugin => ({
install: ({ config, provide }: App): void =>
{
const $vuert = new Vuert(options);

_setActiveVuert($vuert);
_setActiveVuert($vuert);

config.globalProperties.$vuert = $vuert;
provide(InjectionKeys.$vuert, $vuert);
}
};
};
config.globalProperties.$vuert = $vuert;
provide(InjectionKeys.$vuert, $vuert);
}
});
export const useVuert = (): Vuert =>
{
const $vuert = _getActiveVuert();
Expand Down
4 changes: 3 additions & 1 deletion packages/nuxt/src/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export default defineNuxtPlugin({
{
const options: Partial<VuertOptions> = nuxtApp.$config.public.vuert || { };

nuxtApp.vueApp.use(createVuert(options));
// SMELLS: Remove `as any` when Nuxt.js will be properly typed.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
nuxtApp.vueApp.use(createVuert(options) as any);

return { provide: { vuert: useVuert() } };
}
Expand Down

0 comments on commit dd5776f

Please sign in to comment.