subx 1.17.0 copy "subx: ^1.17.0" to clipboard
subx: ^1.17.0 copied to clipboard

RxDart Subscriptions management. Provide Apis to store and manage RxDart subscriptions and provide methods to unsubscribe them all.

example/example.dart

// ignore_for_file: avoid_print

import 'package:subx/subx.dart';

void main() async {
  final subxList = SubxList();
  final source = Stream.periodic(const Duration(milliseconds: 500), (counter) {
    return ++counter;
  });

  final source2 = Stream.periodic(const Duration(seconds: 1), (counter) {
    return ++counter;
  });

  final subscription = source.listen(
    (data) => print('Subscription1: $data'),
  );

  final subscription2 = source2.listen(
    (data) => print('Subscription2: $data'),
  );

  subxList
    ..add(subscription)
    ..add(subscription2);

  await Future.delayed(const Duration(seconds: 2), () {
    return subxList.cancelAll();
  });
}
0
likes
160
pub points
18%
popularity

Publisher

unverified uploader

RxDart Subscriptions management. Provide Apis to store and manage RxDart subscriptions and provide methods to unsubscribe them all.

Repository (GitHub)
View/report issues

Documentation

API reference

License

ISC (LICENSE)

Dependencies

async, flutter

More

Packages that depend on subx