MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / send

Method send

src/lib/EventHandler.js:226–240  ·  view source on GitHub ↗

* Like emit but receiver can send response * @param {String} event The event descriptor * @param {Object} options (optional) Data to be sent in the event * @param {Object} port (optional) The port to be used. If * not specified, the main port is u

(event, options = {})

Source from the content-addressed store, hash-verified

224 * @return {Promise}
225 */
226 send(event, options = {}) {
227 return new Promise((resolve, reject) => {
228 if (!event || typeof event !== 'string') {
229 return reject(new Error('Invalid event!'));
230 }
231 this.#checkConnection();
232 if (!this.#reply) {
233 this.#reply = new Map();
234 }
235 options.event = event;
236 options._reply = ++this.#replyCount;
237 this.#reply.set(options._reply, {resolve, reject});
238 this._port.postMessage(options);
239 });
240 }
241}

Callers 15

initMethod · 0.45
getSecurityBackgroundFunction · 0.45
componentDidMountFunction · 0.45
handleChangePrefsFunction · 0.45
app.jsFile · 0.45
handleSkipFunction · 0.45
getKeyDetailsMethod · 0.45
validateKeyPasswordMethod · 0.45
handleRevokeMethod · 0.45
handleSetExDateMethod · 0.45
handleChangePwdMethod · 0.45
handleKeyServerSyncMethod · 0.45

Calls 3

#checkConnectionMethod · 0.95
setMethod · 0.45
postMessageMethod · 0.45

Tested by

no test coverage detected