Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
4b5929d5
Commit
4b5929d5
authored
Oct 25, 2017
by
Patrick O'Carroll
Committed by
Torkel Ödegaard
Oct 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
converted timer.js to timer.ts (#9656)
parent
17d95dc8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
33 deletions
+32
-33
public/app/core/services/timer.js
+0
-33
public/app/core/services/timer.ts
+32
-0
No files found.
public/app/core/services/timer.js
deleted
100644 → 0
View file @
17d95dc8
define
([
'angular'
,
'lodash'
,
'../core_module'
,
],
function
(
angular
,
_
,
coreModule
)
{
'use strict'
;
coreModule
.
default
.
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
.
cancelAll
=
function
()
{
_
.
each
(
timers
,
function
(
t
)
{
$timeout
.
cancel
(
t
);
});
timers
=
[];
};
});
});
public/app/core/services/timer.ts
0 → 100644
View file @
4b5929d5
import
_
from
'lodash'
;
import
coreModule
from
'app/core/core_module'
;
export
class
Timer
{
timers
=
[];
/** @ngInject */
constructor
(
private
$timeout
)
{
}
register
(
promise
)
{
this
.
timers
.
push
(
promise
);
return
promise
;
}
cancel
(
promise
)
{
console
.
log
(
promise
);
this
.
timers
=
_
.
without
(
this
.
timers
,
promise
);
this
.
$timeout
.
cancel
(
promise
);
}
cancelAll
()
{
_
.
each
(
this
.
timers
,
function
(
t
)
{
this
.
$timeout
.
cancel
(
t
);
});
this
.
timers
=
[];
}
}
coreModule
.
service
(
'timer'
,
Timer
);
// This service really just tracks a list of $timeout promises to give us a
// method for cancelling them all when we need to
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment