MCPcopy Create free account
hub / github.com/d3/d3-queue / end

Function end

src/queue.js:73–87  ·  view source on GitHub ↗
(q, i)

Source from the content-addressed store, hash-verified

71}
72
73function end(q, i) {
74 return function(e, r) {
75 if (!q._tasks[i]) return; // ignore multiple callbacks
76 --q._active, ++q._ended;
77 q._tasks[i] = null;
78 if (q._error != null) return; // ignore secondary errors
79 if (e != null) {
80 abort(q, e);
81 } else {
82 q._data[i] = r;
83 if (q._waiting) poke(q);
84 else maybeNotify(q);
85 }
86 };
87}
88
89function abort(q, e) {
90 var i = q._tasks.length, t;

Callers 1

startFunction · 0.85

Calls 3

abortFunction · 0.85
pokeFunction · 0.85
maybeNotifyFunction · 0.85

Tested by

no test coverage detected