Process Value

License: MIT

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.

Installation 💻

❗ 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

Usage

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);
}

Libraries

process_value
A declarative representation of a process