MCPcopy
hub / github.com/ampproject/amphtml / fire

Method fire

src/core/data-structures/observable.js:57–65  ·  view source on GitHub ↗

* Fires an event. All observers are called. * @param {TYPE=} opt_event

(opt_event)

Source from the content-addressed store, hash-verified

55 * @param {TYPE=} opt_event
56 */
57 fire(opt_event) {
58 if (!this.handlers_) {
59 return;
60 }
61 // Iterate over copy of handlers_ in case handlers are removed inside.
62 for (const handler of this.handlers_.slice()) {
63 handler(opt_event);
64 }
65 }
66
67 /**
68 * Returns number of handlers. Mostly needed for tests.

Callers 15

onTouchStart_Method · 0.45
signalEmit_Method · 0.45
onKeyDown_Method · 0.45
onMouseDown_Method · 0.45
mouseConfirmed_Method · 0.45
pushFocus_Method · 0.45
toggleRuntimeMethod · 0.45
onMessageMethod · 0.45
receiveMessageMethod · 0.45
endSessionMethod · 0.45
init_Method · 0.45

Calls 1

handlerFunction · 0.50

Tested by

no test coverage detected