Skip to content

Commit

Permalink
feat: better hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
lesnitsky committed Apr 23, 2024
1 parent b314a80 commit 79cb8fd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ sealed class Result<T> {
}
}

sealed class LateResult<T> {
sealed class LateResult<T> implements Result<T> {
const factory LateResult.pending() = Pending<T>._;
const factory LateResult.success(T value) = Success<T>._;
const factory LateResult.failure([
Object? failure,
Object? exception,
StackTrace? stackTrace,
]) = Failure<T>._;

Expand All @@ -38,15 +38,15 @@ sealed class LateResult<T> {

try {
await for (final value in stream) {
yield Late.success(value);
yield Success<T>._(value);
}
} catch (e, s) {
yield Late.failure(e, s);
yield Failure<T>._(e, s);
}
}
}

sealed class AsyncResult<T> {
sealed class AsyncResult<T> implements Result<T> {
/// Creates a [Success] result.
const factory AsyncResult.success(T value) = Success<T>._;

Expand Down Expand Up @@ -76,7 +76,7 @@ sealed class AsyncResult<T> {
}
}

sealed class LateAsyncResult<T> {
sealed class LateAsyncResult<T> implements Async<T>, Late<T> {
const factory LateAsyncResult.pending() = Pending<T>._;
const factory LateAsyncResult.success(T value) = Success<T>._;
const factory LateAsyncResult.failure([
Expand Down

0 comments on commit 79cb8fd

Please sign in to comment.