register<E extends JEffect> method

void register<E extends JEffect>(
  1. Future<void> handler(
    1. E effect,
    2. JController<T> controller
    )
)

Registers a handler for a specific type of JEffect.

The handler function receives both the effect instance and the controller. Use this to define how each specific effect should be handled in the UI.

Implementation

void register<E extends JEffect>(
  Future<void> Function(E effect, JController<T> controller) handler,
) {
  _handlers[E] = (effect, controller) => handler(effect as E, controller);
}