Skip to content
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

TypeScript support for Class Based Components? #13

Open
IAMtheIAM opened this issue Mar 24, 2021 · 1 comment
Open

TypeScript support for Class Based Components? #13

IAMtheIAM opened this issue Mar 24, 2021 · 1 comment

Comments

@IAMtheIAM
Copy link

Awesome work here.

Can we get a small update to work with TypeScript support for Class Based Components? It works but IDE complains about the unknown $async function and async mixin in the vue template, and the $async function in the typescript file as well.

@IAMtheIAM
Copy link
Author

IAMtheIAM commented Mar 25, 2021

I partially got it working. In the vue template, just adding this works to get intellisence i.e. this.async$()

However, I still get undefined references in the typescript component definition. If I create an interace:

export interface asnycPipeFunction  {
    $async: (asyncDatum, key) => any
}

const isReady = (this as unknown as asnycPipeFunction).$async(this.someThingToCheck$, 'filters');

console.log(isReady);

Then intellisence is happy. But I think this should be included in the package TypeScript definition file. I'll create a PR if you will pull it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant