implemented toasts

This commit is contained in:
Fran Jurmanović
2021-06-12 21:21:03 +02:00
parent ecedbb8b57
commit 64b54b3568
17 changed files with 7186 additions and 11 deletions

20
src/core/utils/timer.ts Normal file
View File

@@ -0,0 +1,20 @@
const Timer = function (callback, delay, ...args) {
var timerId,
start,
remaining = delay;
this.pause = function () {
window.clearTimeout(timerId);
remaining -= Date.now() - start;
};
this.resume = function () {
start = Date.now();
window.clearTimeout(timerId);
timerId = window.setTimeout(callback, remaining, ...args);
};
this.resume();
};
export default Timer;