Sha256: f453343d9df8d0cf63198281a2093a9dccdb1ccc25d0b100ad4380d1958ebb6a
Contents?: true
Size: 693 Bytes
Versions: 8
Compression:
Stored size: 693 Bytes
Contents
define([ 'angular', 'lodash' ], function (angular, _) { 'use strict'; var module = angular.module('kibana.services'); module.service('timer', function($timeout) { // This service really just tracks a list of $timeout promises to give us a // method for cancelling them all when we need to var timers = []; this.register = function(promise) { timers.push(promise); return promise; }; this.cancel = function(promise) { timers = _.without(timers,promise); $timeout.cancel(promise); }; this.cancel_all = function() { _.each(timers, function(t){ $timeout.cancel(t); }); timers = []; }; }); });
Version data entries
8 entries across 8 versions & 1 rubygems