onDisconnect property

EventStream<Port> get onDisconnect

Fired when the port is disconnected from the other end(s). runtime.lastError may be set if the port was disconnected by an error. If the port is closed via $(ref:Port.disconnect disconnect), then this event is only fired on the other end. This event is fired at most once (see also Port lifetime).

Implementation

EventStream<Port> get onDisconnect =>
    _wrapped.onDisconnect.asStream(($c) => ($js.Port port) {
          return $c(Port.fromJS(port));
        }.toJS);