subx 1.12.0 copy "subx: ^1.12.0" to clipboard
subx: ^1.12.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
0
pub points
4%
popularity

Publisher

unverified uploader

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

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

async, flutter

More

Packages that depend on subx