MCPcopy Create free account
hub / github.com/docker/getting-started / onEnd

Function onEnd

app/src/static/js/react-bootstrap.js:1583–1604  ·  view source on GitHub ↗
(node, handler, duration)

Source from the content-addressed store, hash-verified

1581var _style = _interopRequireDefault(__webpack_require__(11));
1582
1583function onEnd(node, handler, duration) {
1584 var fakeEvent = {
1585 target: node,
1586 currentTarget: node
1587 },
1588 backup;
1589 if (!_properties.default.end) duration = 0;else if (duration == null) duration = parseDuration(node) || 0;
1590
1591 if (_properties.default.end) {
1592 node.addEventListener(_properties.default.end, done, false);
1593 backup = setTimeout(function () {
1594 return done(fakeEvent);
1595 }, (duration || 100) * 1.5);
1596 } else setTimeout(done.bind(null, fakeEvent), 0);
1597
1598 function done(event) {
1599 if (event.target !== event.currentTarget) return;
1600 clearTimeout(backup);
1601 event.target.removeEventListener(_properties.default.end, done);
1602 handler.call(this);
1603 }
1604}
1605
1606onEnd._parseDuration = parseDuration;
1607var _default = onEnd;

Callers

nothing calls this directly

Calls 2

parseDurationFunction · 0.85
doneFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…