Skip to content

Add notStarted() to result DSL#42

Merged
mrmans0n merged 2 commits intomainfrom
feature/add-notstarted-dsl
Feb 11, 2026
Merged

Add notStarted() to result DSL#42
mrmans0n merged 2 commits intomainfrom
feature/add-notstarted-dsl

Conversation

@mrmans0n
Copy link
Owner

This PR adds the notStarted() function to the result DSL, allowing users to short-circuit with NotStarted state similar to how loading() and error() work.

Changes

  • Added notStarted() to ResultScope interface
  • Implemented notStarted() in ResultScopeImpl to short-circuit with NotStarted
  • Updated ResultScope KDoc to mention notStarted in the list of provided functions
  • Added test for notStarted() in AsyncResultResultDslTest

Example usage

val result = result<Int> {
  if (!isInitialized) {
    notStarted()
  }
  // ... rest of computation
}

All tests passing ✅

- Add notStarted() function to ResultScope interface
- Implement notStarted() in ResultScopeImpl to short-circuit with NotStarted
- Update ResultScope KDoc to mention notStarted in the list of provided functions
- Add test for notStarted() in AsyncResultResultDslTest
- Add notStarted() function to short-circuit with NotStarted
- Add error(Error) overload to short-circuit with Error instance
- Add errorWithMetadata() to short-circuit with typed metadata
- Update ResultScope KDoc to mention new functions
- Add tests for all three new functions
@mrmans0n mrmans0n merged commit f3e4258 into main Feb 11, 2026
@github-actions
Copy link
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://mrmans0n.github.io/asyncresult/pr-preview/pr-42/

Built to branch gh-pages at 2026-02-11 14:49 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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