respondTo<E extends JEffect<V>, V> method

void respondTo<E extends JEffect<V>, V>(
  1. V response(
    1. E effect
    )
)

Completes effects of exactly type E with the value response returns.

If response throws, the effect completes with that error.

Implementation

void respondTo<E extends JEffect<V>, V>(V Function(E effect) response) {
  _responders[E] = (effect) => response(effect as E);
}