when_async 1.0.0 copy "when_async: ^1.0.0" to clipboard
when_async: ^1.0.0 copied to clipboard

discontinued
outdated

APIs for easy consumption of asynchronous computations

when_async #

APIs for easy consumption of asynchronous computations

Usage #

A simple usage example:

import 'package:when_async/when_async.dart';

main() {
  final _when = When.future<int>(
    Future.delayed(
      const Duration(seconds: 5),
      () => 1,
    ),
  );

  _when.execute(
    onLoading: () => stdout.writeln('Loading'),
    onComplete: (it) => stdout.writeln('$it'),
    onError: (e, s) => stdout.writeln('$e\n$s'),
    onFinally: () => stdout.writeln('Finally'),
  );

  // OR

  _when.snapshots((snapshot) { 
     stdout.writeln('Snapshot: ${snapshot.state}')
  });
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

3
likes
0
pub points
4%
popularity

Publisher

verified publishermagnificsoftware.com

APIs for easy consumption of asynchronous computations

Homepage

License

unknown (LICENSE)

Dependencies

meta

More

Packages that depend on when_async