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

fix: type for resolved value #5

Merged
merged 1 commit into from
Dec 20, 2021
Merged

Conversation

rnike
Copy link
Contributor

@rnike rnike commented Sep 30, 2021

Found out that the type declaration for the resolving value is not actually correct.

According to the source code, there are two kinds of resolve

  1. [error] = [error,undefined]
  2. [undefined, data]

The type for error and data should be both optional. e.g. [error?: Error, data?: T]

I choose to use [error: Error] | [error: undefined, data: T] instead because this is what it actually resolved

@DavidWells DavidWells merged commit 3b7fb5a into DavidWells:master Dec 20, 2021
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.

None yet

2 participants