rx/rx_workers library

Rx Workers - Workers for reactive operations

Classes

Worker
Worker class to manage reactive subscriptions
Workers
Workers container to manage multiple workers

Extensions

RxWorkerExtension on RxInterface<T>
Extension on RxInterface for easier worker usage

Functions

debounce<T>(RxInterface<T> observable, WorkerCallback<T> callback, {Duration time = const Duration(milliseconds: 500)}) Worker
Executes a callback after delay of no changes (debounce). Similar to interval but sends the last value after user stops changing it.
ever<T>(RxInterface<T> observable, WorkerCallback<T> callback, {dynamic condition, Duration? debounce}) Worker
Executes a callback every time the value of observable changes.
everAll<T>(List<RxInterface<T>> observables, WorkerCallback<T> callback, {dynamic condition}) Worker
Similar to ever, but takes a list of observables. The condition is common to all observables.
interval<T>(RxInterface<T> observable, WorkerCallback<T> callback, {Duration delay = const Duration(seconds: 1), dynamic condition}) Worker
Executes a callback after delay if the value of observable doesn't change.
once<T>(RxInterface<T> observable, WorkerCallback<T> callback, {dynamic condition}) Worker
Executes a callback the first time the value of observable changes.
workers() Workers
Create workers container

Typedefs

WorkerCallback<T> = void Function(T value)