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

Better TypeScript type inference for promiseFn / deferFn args #74

Open
LennardWesterveld opened this issue Aug 8, 2019 · 4 comments
Open
Labels
enhancement Enhancement to existing feature help wanted Extra attention is needed

Comments

@LennardWesterveld
Copy link

I'm missing a option like https://www.npmjs.com/package/react-async-hook has for typescript that you can give as second option a array of the values you want to give to the async function. It is also nice typed because the array says also witch value it expecting related to the async function.

@LennardWesterveld LennardWesterveld changed the title [Feature request] Better way to add variables with typescript [Feature request] Better way to add function argument with typescript Aug 8, 2019
@ghengeveld
Copy link
Member

Hey Lennard, thanks for the feedback. I'm looking into ways to improve TypeScript support. In fact I've already found a few places where things can be improved.

You can in fact pass additional props to the async function, but their type will just be any. I'll investigate ways to make these typed somehow, if you want you can take a stab at it. Make sure to check out #73, there's a lot of improvements in there already. 👍

@ghengeveld ghengeveld changed the title [Feature request] Better way to add function argument with typescript Better TypeScript type inference for promiseFn / deferFn args Aug 13, 2019
@ghengeveld ghengeveld added enhancement Enhancement to existing feature help wanted Extra attention is needed labels Aug 13, 2019
@ghost
Copy link

ghost commented Nov 21, 2019

how is this looking in the upcoming v10?

@ghengeveld
Copy link
Member

I suspect no change, but you can try 10.0.0-alpha.0.

@freeman
Copy link

freeman commented Jan 23, 2020

It seems this is going to be adressed in #246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to existing feature help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants