Skip to content

Add better type definitions for Promise onrejected #33

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

Closed
wants to merge 1 commit into from

Conversation

uinz
Copy link

@uinz uinz commented Jun 15, 2023

#32

Made a few changes:

  1. promise.catch is not allowed to accept null undefined and is not optional
  2. The final type is the union type of onfulfilled and onrejected

@uinz
Copy link
Author

uinz commented Jun 15, 2023

Oh, wait. I found out that things were worse than I thought

The following code is actually legal.

image

Close first, I need to research

@uinz uinz closed this Jun 15, 2023
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.

1 participant