Skip to content

feat: add async versions of some methods#25

Merged
madkarmaa merged 21 commits into
mainfrom
feat/async-support
May 28, 2026
Merged

feat: add async versions of some methods#25
madkarmaa merged 21 commits into
mainfrom
feat/async-support

Conversation

@madkarmaa

@madkarmaa madkarmaa commented May 26, 2026

Copy link
Copy Markdown
Owner

What changed?

Async methods for chaining of async Results and Options.

Why?

Less annoying chaning operations with async Results and Options.

Checklist

  • Tests added or updated
  • bun run typecheck && bun run test passes

@madkarmaa madkarmaa self-assigned this May 26, 2026
@madkarmaa madkarmaa added feat New feature or request minor Will result in a minor version bump labels May 26, 2026
@madkarmaa madkarmaa force-pushed the feat/async-support branch from 733b6f9 to 63e91a9 Compare May 27, 2026 10:12
@madkarmaa madkarmaa added major Will result in a major version bump and removed minor Will result in a minor version bump labels May 27, 2026
@madkarmaa madkarmaa added minor Will result in a minor version bump and removed major Will result in a major version bump labels May 27, 2026
@madkarmaa madkarmaa force-pushed the feat/async-support branch from 3dda1ff to 743092a Compare May 27, 2026 13:19
@madkarmaa madkarmaa added major Will result in a major version bump and removed minor Will result in a minor version bump labels May 27, 2026
@madkarmaa madkarmaa force-pushed the feat/async-support branch from c367046 to e218e18 Compare May 27, 2026 14:44
@madkarmaa madkarmaa added minor Will result in a minor version bump and removed major Will result in a major version bump labels May 27, 2026
@madkarmaa madkarmaa requested a review from Copilot May 27, 2026 14:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds async-friendly chaining for Result and Option by introducing AsyncResult/AsyncOption wrappers (awaitable + chainable), plus async counterparts to common combinators on the sync types.

Changes:

  • Added AsyncResult / AsyncOption (PromiseLike wrappers) to support fluent async pipelines.
  • Added async variants of key Result and Option methods (mapAsync, andThenAsync, orElseAsync, etc.).
  • Added comprehensive vitest coverage for async chaining and mixed sync/async pipelines.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
tests/result.async.test.ts New test suite covering async Result APIs and complex pipelines.
tests/option.async.test.ts New test suite covering async Option APIs and complex pipelines.
src/result.ts Adds async combinators returning AsyncResult; tweaks isOk/isErr type guards.
src/option.ts Adds async combinators returning AsyncOption / AsyncResult, including async mutation helper.
src/index.ts Re-exports AsyncResult / AsyncOption types.
src/async-result.ts Implements AsyncResult wrapper and chainable async methods.
src/async-option.ts Implements AsyncOption wrapper and chainable async methods.

Comment thread src/result.ts
Comment thread src/result.ts
Comment thread src/result.ts
Comment thread src/result.ts
Comment thread src/result.ts
Comment thread src/option.ts Outdated
Comment thread src/option.ts Outdated
Comment thread src/option.ts
Comment thread src/option.ts Outdated
Comment thread src/option.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment thread src/option.ts Outdated
Comment thread tests/result.async.test.ts Outdated
Comment thread tests/option.async.test.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread src/option.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread src/result.ts
Comment thread src/result.ts
@madkarmaa madkarmaa merged commit d7c3f0a into main May 28, 2026
2 checks passed
@madkarmaa madkarmaa deleted the feat/async-support branch May 28, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New feature or request minor Will result in a minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants