Bloom<T>.error constructor

Bloom<T>.error(
  1. Object error, [
  2. StackTrace? stackTrace
])

Creates a constant static leaf node permanently in an Error state.

  • error: The exception or error payload.
  • stackTrace: Optional stack trace associated with the failure.

Ensures:

Examples

final failedNode = Bloom<int>.error(StateError('Resource offline'));
print(untracked.state(failedNode).hasError); // true

Implementation

factory Bloom.error(Object error, [StackTrace? stackTrace]) = _ConstantBloom<T>.error;