operator + method

void operator +(
  1. EventHandler<T> handler
)

Adds a handler (callback) that will be executed when this Event is raised using the broadcast method.

Uses "+" as an alternative syntax to the subscribe method for adding a handler (callback) that will be executed when this Event is fired using the broadcast method.

// Example
counter.onValueChanged + (args) => print('value changed');

Implementation

void operator +(EventHandler<T> handler) {
  subscribe(handler);
}