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

Method trigger

src/lib/EventHandler.js:206–216  ·  view source on GitHub ↗
(event, options = {})

Source from the content-addressed store, hash-verified

204 }
205
206 trigger(event, options = {}) {
207 if (!event || typeof event !== 'string') {
208 throw new Error('Invalid event!');
209 }
210 options.event = event;
211 if (!this._handlers.has(options.event)) {
212 throw new Error('Unknown event!');
213 }
214 const handler = this._handlers.get(options.event);
215 handler.call(this, options);
216 }
217
218 /**
219 * Like emit but receiver can send response

Callers

nothing calls this directly

Calls 2

hasMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected