isTrue method

ActorBuilder isTrue(
  1. bool predicate(
    1. Object? message
    ),
  2. Actor actor
)

Handle a message if the given predicate returns true.

Implementation

ActorBuilder isTrue(bool Function(Object? message) predicate, Actor actor) {
  _conditions.add(
    _Condition(
      (ctx, msg) => predicate(msg),
      actor,
    ),
  );
  return this;
}