Skip to content

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

Merged
Planeshifter merged 3 commits intostdlib-js:developfrom
prajwalkulkarni:async-if-else
Feb 25, 2024
Merged

refactor: improve type definitions for async/if else#1381
Planeshifter merged 3 commits intostdlib-js:developfrom
prajwalkulkarni:async-if-else

Conversation

@prajwalkulkarni
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@Planeshifter could you kindly review the changes?

Copy link
Copy Markdown
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!

Comment thread lib/node_modules/@stdlib/utils/async/if-else/docs/types/index.d.ts Outdated
Comment thread lib/node_modules/@stdlib/utils/async/if-else/docs/types/index.d.ts Outdated
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Comment thread lib/node_modules/@stdlib/utils/async/if-else/docs/types/index.d.ts Outdated
…d.ts

Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
@Planeshifter
Copy link
Copy Markdown
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