Skip to content

Add resultFlow builder with ResultFlowScope - #46

Merged
mrmans0n merged 1 commit into
mainfrom
mrmans0n/flow-result
Feb 15, 2026
Merged

mrmans0n merged 1 commit into
mainfrom
mrmans0n/flow-result

Conversation

@mrmans0n

@mrmans0n mrmans0n commented Feb 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds resultFlow {} factory function that creates Flow<AsyncResult<T>> with explicit emission functions
  • Introduces ResultFlowScope<T> interface with success(), error(), loading(), and notStarted() methods
  • Includes convenience extensions error(Throwable, ErrorId?) and errorWithMetadata(Any, ErrorId?)
  • Uncaught exceptions (except CancellationException) are caught and emitted as Error

Test plan

  • 14 tests covering all emission types, error handling, CancellationException propagation, empty blocks, mixed emissions, and partial-emission exception behavior
  • Tests pass on JVM and JS Node
  • No regressions in existing tests
  • Spotless formatting applied

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mrmans0n
mrmans0n force-pushed the mrmans0n/flow-result branch from 93390fb to da4e8e2 Compare February 15, 2026 21:07
@github-actions

github-actions Bot commented Feb 15, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-02-15 21:12 UTC

@mrmans0n
mrmans0n merged commit e74ca61 into main Feb 15, 2026
3 checks passed
@mrmans0n
mrmans0n deleted the mrmans0n/flow-result branch February 15, 2026 21:12
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.

1 participant