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

This package provides a capability for cancellation.

cancellable #

This package provides a capability for cancellation.

Usage #

  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

See example for detailed test case.

Issues #

If you encounter issues, here are some tips for debug, if nothing helps report to issue tracker on GitHub:

2
likes
0
points
535
downloads

Publisher

verified publisheraymtools.com

Weekly Downloads

This package provides a capability for cancellation.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

weak_collections

More

Packages that depend on cancellable