route method

Stream<T> route (bool predicate(T event))

Events that match predicate are sent to the stream created by this method, and not sent to any other router streams.

Implementation

Stream<T> route(bool predicate(T event)) {
  var controller = new StreamController<T>.broadcast();
  _routes.add(new _Route(predicate, controller));
  return controller.stream;
}