I've need to create a petite-vue directive that allows for async calls...however, I get the TypeScript error:
Argument of type '(ctx: DirectiveContext) => Promise' is not assignable to parameter of type 'Directive'. Type 'Promise' is not assignable to type 'void | (() => void)'.
const app = PetiteVue.createApp({ count: 1 });
app.directive("my-dir", async ctx => {
const response = await someGlobalAsync();
// use response to do something...
});
app.mount("#myElement");