wallet-core/extension/lib/wallet/timerThread.ts

10 lines
323 B
TypeScript
Raw Normal View History

2015-12-17 13:37:57 +01:00
/**
* This file should be used as a WebWorker.
* Background pages in the WebExtensions model do
* not allow to schedule callbacks that should be called
* after a timeout. We can emulate this with WebWorkers.
*/
2015-12-16 10:48:54 +01:00
onmessage = function(e) {
self.setInterval(() => postMessage(true, "timerThread"), e.data.interval);
2016-01-05 14:20:13 +01:00
};