Overview
Thecombine and combineWithAllErrors static methods allow you to combine multiple ResultAsync instances into a single ResultAsync.
Signatures
ResultAsync.combine
ResultAsync.combineWithAllErrors
Usage
Parallel async operations
Heterogeneous operations
Short-circuit behavior
Collect all errors
Real-world examples
Form validation
Parallel API calls
Key characteristics
combine
- Short-circuits: Stops at first error
- Efficient: May not execute all operations
- Single error: Returns first error encountered
combineWithAllErrors
- Exhaustive: Executes all operations
- Complete: Collects all errors
- Error array: Returns array of all errors
Related
Result.combine
Synchronous version
Combining Results Guide
Detailed usage patterns