MCPcopy
hub / github.com/mailvelope/mailvelope / emit

Method emit

src/lib/EventHandler.js:197–204  ·  view source on GitHub ↗

* Helper to emit events via postMessage using a port. * @param {String} event The event descriptor * @param {Object} options (optional) Data to be sent in the event

(event, options = {})

Source from the content-addressed store, hash-verified

195 * @param {Object} options (optional) Data to be sent in the event
196 */
197 emit(event, options = {}) {
198 if (!event || typeof event !== 'string') {
199 throw new Error('Invalid event!');
200 }
201 this.#checkConnection();
202 options.event = event;
203 this._port.postMessage(options);
204 }
205
206 trigger(event, options = {}) {
207 if (!event || typeof event !== 'string') {

Callers 15

handlePortMessageMethod · 0.95
constructorFunction · 0.45
handleClickFunction · 0.45
logUserInputFunction · 0.45
constructorFunction · 0.45
logUserInputFunction · 0.45
handleCancelFunction · 0.45
handleConfirmFunction · 0.45
constructorFunction · 0.45
onValidatedFunction · 0.45
onFormSandboxErrorFunction · 0.45
onResizeFunction · 0.45

Calls 2

#checkConnectionMethod · 0.95
postMessageMethod · 0.45

Tested by

no test coverage detected