EventBinding constructor
EventBinding(
- Element element,
- String type,
- DomEventCallback fn
Implementation
EventBinding(web.Element element, this.type, this.fn) {
_subscription = web.EventStreamProvider<web.Event>(type).forElement(element).listen((event) {
// Do not move to a field initializer: we need fn here to refer to the
// field and not the constructor parameter.
fn(event);
});
}