MCPcopy Create free account
hub / github.com/microsoft/SandDance / forEachAccumulated

Function forEachAccumulated

docs/external/js/react-dom.development.js:3378–3384  ·  view source on GitHub ↗

* @param {array} arr an "accumulation" of items which is either an Array or * a single item. Useful when paired with the `accumulate` module. This is a * simple utility that allows us to reason about a collection of items, but * handling the case when there is exactly one item (and we do no

(arr, cb, scope)

Source from the content-addressed store, hash-verified

3376 * @param {?} [scope] Scope used as `this` in a callback.
3377 */
3378 function forEachAccumulated(arr, cb, scope) {
3379 if (Array.isArray(arr)) {
3380 arr.forEach(cb, scope);
3381 } else if (arr) {
3382 cb.call(scope, arr);
3383 }
3384 }
3385
3386 /**
3387 * Internal queue of events that have accumulated their dispatches and are

Callers 3

runEventsInBatchFunction · 0.85

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected