MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / initPort

Method initPort

src/lib/EventHandler.js:69–79  ·  view source on GitHub ↗
(port)

Source from the content-addressed store, hash-verified

67 }
68
69 initPort(port) {
70 this._port = port;
71 this._port.onMessage.addListener(this.handlePortMessage.bind(this));
72 this.#portName = port.name;
73 if (this._port.onDisconnect) {
74 this._port.onDisconnect.addListener(() => this.handleDisconnect());
75 for (const listener of this.#disconnectListener) {
76 this._port.onDisconnect.addListener(listener);
77 }
78 }
79 }
80
81 handleDisconnect() {
82 this.clearPort();

Callers 3

constructorMethod · 0.95
#checkConnectionMethod · 0.95
addPortMethod · 0.80

Calls 1

handleDisconnectMethod · 0.95

Tested by

no test coverage detected