mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Enable object-shorthand rule (#1500)
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
2a8cfe5e67
commit
ff93760dc4
42 files changed
+69
-66
No files matched your search
@@ -1,5 +1,5 @@
|
||||
export function downloadFile(filename: string, contents: any, type: string) {
|
||||
const data = new Blob([contents], { type: type });
|
||||
const data = new Blob([contents], { type });
|
||||
const url = URL.createObjectURL(data);
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
|
||||
@@ -7,19 +7,19 @@ export function interval(timeSec = 1, callback: IntervalCallback, autoRun = fals
|
||||
let timer = -1;
|
||||
let isRunning = false;
|
||||
const intervalManager = {
|
||||
start: function (runImmediately = false) {
|
||||
start (runImmediately = false) {
|
||||
if (isRunning) return;
|
||||
const tick = () => callback(++count);
|
||||
isRunning = true;
|
||||
timer = window.setInterval(tick, 1000 * timeSec);
|
||||
if (runImmediately) tick();
|
||||
},
|
||||
stop: function () {
|
||||
stop () {
|
||||
count = 0;
|
||||
isRunning = false;
|
||||
clearInterval(timer);
|
||||
},
|
||||
restart: function (runImmediately = false) {
|
||||
restart (runImmediately = false) {
|
||||
this.stop();
|
||||
this.start(runImmediately);
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user