Loading

Functions

Link copied to clipboard
open fun <T, R> Result<T>.andThen(onSuccess: @Composable (T) -> Result<R>): Result<R>

Convenience to chain the result of one Result into another, forwarding loading and error states, and mapping the success to another Result.

Link copied to clipboard
open fun <T, R> Result<T>.andThen(onSuccess: @Composable (T) -> Result<R>): Result<R>

Convenience to chain the result of one Result into another, forwarding loading and error states, and mapping the success to another Result.

Link copied to clipboard
open fun <T> Iterable<Result<T>>.sequence(): Result<List<T>>

Convenience to join a list of Results into a Result of one List. Any loading or error states will become the final Result state.

Link copied to clipboard
open fun <A, B> Result<A>.zip(other: Result<B>): Result<Pair<A, B>>

Convenience to join two Results into one, forwarding loading and error states, and mapping the combination to a Pair.

open fun <A, B, R> Result<A>.zip(other: Result<B>, combine: (A, B) -> R): Result<R>

Convenience to join two Results into one, forwarding loading and error states, and mapping the combination to another Result.

Link copied to clipboard
open fun <A, B> Result<A>.zip(other: Result<B>): Result<Pair<A, B>>

Convenience to join two Results into one, forwarding loading and error states, and mapping the combination to a Pair.

open fun <A, B, R> Result<A>.zip(other: Result<B>, combine: (A, B) -> R): Result<R>

Convenience to join two Results into one, forwarding loading and error states, and mapping the combination to another Result.