watcher<A, S> function

Watcher<A, S> watcher<A, S>(
  1. Worker<A, S> worker,
  2. Stream<A> select(
    1. Stream actionStream,
    2. WorkerContext<S> context
    )
)

Implementation

Watcher<A, S> watcher<A, S>(
  Worker<A, S> worker,
  Stream<A> Function(Stream<dynamic> actionStream, WorkerContext<S> context) select
) => Watcher<A, S>(
    watch: (Stream<dynamic> actionStream, WorkerContext<S> context) async {
      await applyWorker<A, S>(
          select(actionStream, context),
          context,
          worker
      );
    }
);