diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-01-10 20:07:42 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-01-10 20:07:42 +0100 |
commit | 473503a246aa7a23539a349710c5549d1d87c147 (patch) | |
tree | 2b1ee9b420df72a0d861759d1fbcd2226e489086 /extension/lib/wallet/timerThread.ts | |
parent | dd19e0ecbe114ebd71122ff57ea56eabb6258b75 (diff) |
The great modularization.
Use ES6 module syntax and SystemJS modules for everything.
Some testing stubs were added as well.
Diffstat (limited to 'extension/lib/wallet/timerThread.ts')
-rw-r--r-- | extension/lib/wallet/timerThread.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/extension/lib/wallet/timerThread.ts b/extension/lib/wallet/timerThread.ts new file mode 100644 index 000000000..6635da009 --- /dev/null +++ b/extension/lib/wallet/timerThread.ts @@ -0,0 +1,10 @@ +/** + * 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. + */ + +onmessage = function(e) { + self.setInterval(() => postMessage(true, "timerThread"), e.data.interval); +};
\ No newline at end of file |