| Index: ext/background.js |
| =================================================================== |
| --- a/ext/background.js |
| +++ b/ext/background.js |
| @@ -520,9 +520,30 @@ |
| } |
| }; |
| } |
| return ext.onMessage._dispatch( |
| message, sender, sendResponse |
| ).includes(true); |
| }); |
| + |
| + |
| + /* Utilities */ |
| + |
| + let Scheduler = ext.Scheduler = function() |
| + { |
| + this.scheduled = false; |
| + }; |
| + Scheduler.prototype = { |
| + schedule(delay, func) |
| + { |
| + setTimeout(() => |
| + { |
| + this.scheduled = false; |
| + func(); |
| + }, |
| + delay); |
| + |
| + this.scheduled = true; |
| + } |
| + }; |
|
Sebastian Noack
2019/02/03 23:18:03
Please don't add new stuff to ext.*, we eventually
Manish Jethani
2019/02/04 05:33:03
I've moved it into lib/stats.js for now, although
Sebastian Noack
2019/02/04 06:32:04
Well, IMO this pattern isn't worth to be abstracte
Manish Jethani
2019/02/04 06:57:17
Acknowledged.
|
| } |