Skip to content

timcreatedit/process_value

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages