cancellable 1.1.5 copy "cancellable: ^1.1.5" to clipboard
cancellable: ^1.1.5 copied to clipboard

This package provides a capability for cancellation.

example/cancellable_example.dart

import 'package:cancellable/cancellable.dart';

main() {
  Cancellable cancellable = Cancellable();

  var sub =
      Stream.periodic(Duration(milliseconds: 100), (i) => i).listen((event) {
    print(event);
  });

  sub.cancelByCancellable(
      cancellable); //  cancellable.whenCancel.then((value) => sub.cancel());

  Future.delayed(Duration(seconds: 1)).then((value) => cancellable.cancel());

  ///print
  ///0
  // 1
  // 2
  // 3
  // 4
  // 5
  // 6
  // 7
  // 8
  // 9
  // end
}
2
likes
135
points
535
downloads

Publisher

verified publisheraymtools.com

Weekly Downloads

This package provides a capability for cancellation.

Repository (GitHub)
View/report issues

Topics

#cancel #cancelable #cancel-token #cancellation

Documentation

API reference

License

MIT (license)

Dependencies

weak_collections

More

Packages that depend on cancellable