ClosingHandlerRegistration class
Class wrapping window's before closing event in HandlerRegistration manner.
class ClosingHandlerRegistration implements HandlerRegistration { ClosingHandler _handler; dart_async.StreamSubscription listener; ClosingHandlerRegistration(_handler) { listener = dart_html.window.onBeforeUnload.listen(_onData); } void _onData(dart_html.Event evt) { ClosingEvent event = new ClosingEvent(); _handler.onWindowClosing(event); } /** * Deregisters the handler associated with this registration object if the * handler is still attached to the event source. If the handler is no longer * attached to the event source, this is a no-op. */ void removeHandler() { listener.cancel(); } }
Implements
Constructors
new ClosingHandlerRegistration(_handler) #
Properties
StreamSubscription listener #
dart_async.StreamSubscription listener
Methods
void removeHandler() #
Deregisters the handler associated with this registration object if the handler is still attached to the event source. If the handler is no longer attached to the event source, this is a no-op.
void removeHandler() { listener.cancel(); }