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

feat: add errorFirst function #101

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

feat: add errorFirst function #101

wants to merge 4 commits into from

Conversation

aleclarson
Copy link
Member

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

Similar to tryit but without the currying aspect. Only promise-returning functions are supported, and a promise can be passed instead.

const [error, result] = await errorFirst(promise)

const [error, result] = await errorFirst(myFunc, 1, 2, 3, 4)

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed
  • Related benchmarks have been added or updated, if needed

Does this PR introduce a breaking change?

No

@aleclarson aleclarson force-pushed the main branch 2 times, most recently from 2154f96 to 6a4b4f6 Compare July 12, 2024 00:23
@aleclarson aleclarson added new feature This PR adds a new function or extends an existing one stage 0: proposed A proposal for a change that is offered for community and team evaluation. labels Jul 13, 2024
@aleclarson

This comment was marked as outdated.

@aleclarson aleclarson added stage 1: accepted An RFC waiting for someone to implement it. and removed stage 0: proposed A proposal for a change that is offered for community and team evaluation. labels Feb 1, 2025
@aleclarson aleclarson added this to the v12.4.0 milestone Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This PR adds a new function or extends an existing one stage 1: accepted An RFC waiting for someone to implement it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant