Sha256: 210b490aab96ad39de63e451c82fb3654a131858bac836b9b4c518ef86a63704
Contents?: true
Size: 697 Bytes
Versions: 7
Compression:
Stored size: 697 Bytes
Contents
define([ 'angular', 'underscore' ], 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
7 entries across 7 versions & 1 rubygems