disposebag 1.2.0

Dart native js
Flutter Android iOS web

A package to help disposing Streams and closing Sinks easily.

disposebag #

Author: Petrus Nguyễn Thái Học #

Dart CI Codacy Badge Pub codecov Build Status GitHub Style

A package to help disposing Streams and closing Sinks

Usage #

A simple usage example:

import 'package:disposebag/disposebag.dart';
import 'dart:async';

main() async {
  final controllers = <StreamController>[];
  final subscriptions = <StreamSubscription>[];
 
  final bag = DisposeBag([...subscriptions, ...controllers]);

  await Stream.value(3).listen(null).disposedBy(bag);
  await StreamController<int>.broadcast().disposedBy(bag);
  await StreamController<int>.broadcast(sync: true).disposedBy(bag);

  await bag.dispose();
  print("Bag disposed. It's all good");
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

14
likes
110
pub points
83%
popularity

A package to help disposing Streams and closing Sinks easily.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

hoc081098@gmail.com

License

MIT (LICENSE)

Dependencies

collection, meta

More

Packages that depend on disposebag