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

Add type variable to load() to prevent losing type information #2

Merged
merged 1 commit into from
Feb 12, 2019

Conversation

connorlanigan
Copy link
Contributor

@connorlanigan connorlanigan commented Feb 10, 2019

Currently, the function returned by useLoading() takes a generic Promise<any> and also returns a generic Promise<any> (while it always returns the same promise that was passed in). Thus, any type information about the promise is erased to any. With this commit, the promise's value's type is preserved.

@swyxio
Copy link
Owner

swyxio commented Feb 12, 2019

hey Connor, makes sense! thank you!

@swyxio swyxio merged commit a3f00c5 into swyxio:master Feb 12, 2019
@swyxio
Copy link
Owner

swyxio commented Feb 12, 2019

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

Successfully merging this pull request may close these issues.

2 participants