Skip to content

refactor: improve type definitions for async/if else #1381

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

Merged
merged 3 commits into from
Feb 25, 2024

Conversation

prajwalkulkarni
Copy link
Contributor

Resolves #1095

Description

What is the purpose of this pull request?

This pull request:

  • Adds generics to improve type definitions of the ifelseAsync function.
  • Uses optional generic parameter default type U.

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@kgryte kgryte requested a review from Planeshifter February 25, 2024 05:26
@kgryte kgryte added Enhancement Issue or pull request for enhancing existing functionality. Needs Review A pull request which needs code review. TypeScript Issue involves or relates to TypeScript. labels Feb 25, 2024
@prajwalkulkarni
Copy link
Contributor Author

@Planeshifter could you kindly review the changes?

Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR; made a change to the type of ResultFunction to better handle the cases where x and y's types differ, but otherwise this looked good to me!

Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
…d.ts

Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
@Planeshifter
Copy link
Member

Planeshifter commented Feb 25, 2024

Will merge after CI has passed.

@Planeshifter Planeshifter merged commit 6941efb into stdlib-js:develop Feb 25, 2024
@prajwalkulkarni prajwalkulkarni changed the title refactor: improve type definitions for async/if then refactor: improve type definitions for async/if else Feb 26, 2024
@Planeshifter Planeshifter removed the Needs Review A pull request which needs code review. label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Issue or pull request for enhancing existing functionality. TypeScript Issue involves or relates to TypeScript.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: improve type declarations for @stdlib/utils/async/if-else
3 participants