MCPcopy Create free account
hub / github.com/angular-ui/ui-router / setIntervalFn

Function setIntervalFn

test/angular/1.7/angular-mocks.js:646–663  ·  view source on GitHub ↗
(tick, delay, deferred, skipApply)

Source from the content-addressed store, hash-verified

644 nextRepeatId = 0,
645 now = 0,
646 setIntervalFn = function(tick, delay, deferred, skipApply) {
647 var id = nextRepeatId++;
648 var fn = !skipApply ? tick : function() {
649 tick();
650 $browser.defer.flush();
651 };
652
653 repeatFns.push({
654 nextTime: (now + (delay || 0)),
655 delay: delay || 1,
656 fn: fn,
657 id: id,
658 deferred: deferred
659 });
660 repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime; });
661
662 return id;
663 },
664 clearIntervalFn = function(id) {
665 for (var fnIndex = repeatFns.length - 1; fnIndex >= 0; fnIndex--) {
666 if (repeatFns[fnIndex].id === id) {

Callers

nothing calls this directly

Calls 1

tickFunction · 0.70

Tested by

no test coverage detected