Skip to content

Commit

Permalink
More documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mstniy committed Nov 17, 2023
1 parent 8050fbe commit 9f8e001
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/computed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ import 'package:meta/meta.dart';

import 'src/computed.dart';

class NoValueException implements Exception {}

/// Thrown by [Computed.use] if this usage
/// would cause a cyclic dependency.
class CyclicUseException implements Exception {}

/// Reactive computation with a return type of [T]
abstract class Computed<T> {
/// The current result of this computation.
/// If this computation threw, throws the same exception.
Expand Down Expand Up @@ -62,3 +57,11 @@ extension ComputedStreamExtension<T> on Stream<T> {
extension ComputedFutureExtension<T> on Future<T> {
T get use => ComputedFutureExtensionImpl<T>(this).use;
}

/// Thrown when a data source [use]d by a computation
/// has not produced a value yet.
class NoValueException implements Exception {}

/// Thrown by [Computed.use] if this usage
/// would cause a cyclic dependency.
class CyclicUseException implements Exception {}

0 comments on commit 9f8e001

Please sign in to comment.