MCPcopy Create free account
hub / github.com/caike/jQuery-Simple-Timer / emit

Function emit

tests/qunit-2.9.2.js:1263–1275  ·  view source on GitHub ↗

* Emits an event with the specified data to all currently registered listeners. * Callbacks will fire in the order in which they are registered (FIFO). This * function is not exposed publicly; it is used by QUnit internals to emit * logging events. * * @private * @method emit *

(eventName, data)

Source from the content-addressed store, hash-verified

1261 * @return {Void}
1262 */
1263 function emit(eventName, data) {
1264 if (objectType(eventName) !== "string") {
1265 throw new TypeError("eventName must be a string when emitting an event");
1266 }
1267
1268 // Clone the callbacks in case one of them registers a new callback
1269 var originalCallbacks = LISTENERS[eventName];
1270 var callbacks = originalCallbacks ? [].concat(toConsumableArray(originalCallbacks)) : [];
1271
1272 for (var i = 0; i < callbacks.length; i++) {
1273 callbacks[i](data);
1274 }
1275 }
1276
1277 /**
1278 * Registers a callback as a listener to the specified event.

Callers 4

doneFunction · 0.85
qunit-2.9.2.jsFile · 0.85
logSuiteEndFunction · 0.85
beginFunction · 0.85

Calls 2

objectTypeFunction · 0.85
toConsumableArrayFunction · 0.85

Tested by

no test coverage detected