Skip to content

Conversation

@rijenkii
Copy link

@rijenkii rijenkii commented Apr 7, 2025

Fixes #616.

Currently functions map and mapErr cannot receive callbacks that return type A | Promise<B>, because the callback is expected to have return type A | Promise<A>.

This PR fixes this, basically changing function signatures from

<A,>(cb: () => A | Promise<A>): A
<A,>(cb: () => A): Awaited<A>

@changeset-bot
Copy link

changeset-bot bot commented Apr 7, 2025

🦋 Changeset detected

Latest commit: 369b00c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
neverthrow Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@macksal macksal left a comment

Choose a reason for hiding this comment

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

LGTM. Hope the maintainers come across this

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.

Improve ResultAsync.map* method types

2 participants