A declarative representation of a process.
Meant to treat a process declaratively, as a stream of values.
This concept is similar to AsyncValue
from Riverpod but with a much more stripped-down implementation.
❗ In order to start using Process Value you must have the Dart SDK installed on your machine.
Add process_value
to your pubspec.yaml
:
dependencies:
process_value:
Install it:
dart pub get
Stream<ProcessValue<int>> loadMyInteger() async* {
yield ProcessValue.loading(0);
await Future.delayed(const Duration(seconds: 1));
yield ProcessValue.loading(0.5);
await Future.delayed(const Duration(seconds: 1));
yield ProcessValue.loading(0.5);
yield ProcessValue.data(42);
}