RxDart Subscriptions Management

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

Prerequisites

The project has dependencies that require the Dart SDK 2.0

Contents

SubxList

Object that holds and manages a list of Subscriptions.

Usage

import 'package:rxdart/rxdart.dart';
import 'package:subx/subx.dart';

SubxList subxList = SubxList();
BehaviorSubject source = BehaviorSubject();

StreamSubscription subscription = source.listen((data) {...});
StreamSubscription subscription2 = source.listen((data) {...});

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

...

subxList.unsubscribeAll();

API Reference

SubxMap

Object that holds and manages Key-Subscription pairs.

import 'package:rxdart/rxdart.dart';
import 'package:subx/subx.dart';

SubxList subxList = SubxList();
BehaviorSubject source = BehaviorSubject();

StreamSubscription subscription = source.listen((data) {...});
StreamSubscription subscription2 = source.listen((data) {...});

subxList.set('key1', subscription);
subxList.set('key2', subscription2);

...

subxList.unsubscribeAll();

API Reference

Use this package as a library

Depend on it

Run this command:

With Dart:

 $ dart pub add subx

With Flutter:

 $ flutter pub add subx

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):


dependencies:
  subx: ^1.0.4

Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:subx/subx.dart';

example/example.dart

import 'package:subx/subx.dart';

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

  final source2 = Stream.periodic(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);
  subxList.add(subscription2);

  await Future.delayed(Duration(seconds: 2), () {
    return subxList.cancelAll();
  });
}

What is GEEK

Buddha Community

RxDart Subscriptions Management
Origin Scale

Origin Scale

1616572311

Originscale Order Management System

Originscale order management software helps to manage all your orders across channels in a single place. Originscale collects orders across multiple channels in real-time - online, offline, D2C, B2B, and more. View all your orders in one single window and process them with a simple click.

#order management system #ordering management system #order management software #free order management software #purchase order management software #best order management software

Tech Avidus

Tech Avidus

1604379605

Digital Assets Management Software Solution | AI-based Assets Management System

A Digital Asset Management System makes it easier to store, manage, and share all of your digital assets on cloud-based storage.

We help you to build Digital Asset Management (DAM) systems with your precise business requirements, whether you want one for maintaining management, production management, brand management systems, or implementing with your sales department with the digital assets it needs.

To learn more about how the Digital Asset Management system will help your business, email us at hello@techavidus.com

#digital assets management #assets management solution #digital asset management system #production management #brand management

Revenue Cycle Management Software Services and Custom Integration - SISGAIN

Revenues come day in day out and it becomes strenuous to keep a track of them. With the help of Revenue cycle management software, one is able to perform the hospital revenue cycle management in Oklahoma, USA in a much simplified and easy manner. Our skilful developers and engineers created the healthcare revenue cycle management software that is convenient to use by its users and meets the customers requirement. We happen to be one of the notable revenue cycle management companies, facilitating the needs of our customers and being efficient and useful in performance. For more information call us at +18444455767 or email us at hello@sisgain.com

#revenue cycle management #revenue cycle management software #revenue cycle management companies #hospital revenue cycle management #revenue cycle management services #revenue cycle management solutions

Origin Scale

Origin Scale

1619083348

Inventory Management Software

Originscale Inventory Management Software help you seamlessly integrates your sales channels and inventory locations to give your team complete and reliable inventory control. TRY FOR FREE Today

#inventory management #inventory management software #inventory management system #manufacturing inventory management #inventory control software #stock inventory management

Property Management Software Services - SISGAIN

Are you thinking about remodeling your business? SISGAIN is one of the best top property management software companies specialised to make innovative property management software web portals and mobile applications for property management especially designed for automating and modernizing your business with a motive of growth at flexible pricing. Property management product development can really benefit your business in many ways but you’ll have to contact us first. For more information call us at +18444455767 or email us at hello@sisgain.com

#top property management software companies #best property management software #property management product development #real estate management software #property management app