aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/background-main.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-06-07 21:50:14 -0400
committerGitHub <noreply@github.com>2020-06-07 21:50:14 -0400
commit839e306cacbe122803b97589b89798d283069fb9 (patch)
tree2611b2ea5ccc02f502c68adacabc0a2a36092653 /ext/bg/js/background-main.js
parent9767b765536279023045ed4280b12d297ec78f0a (diff)
Immediate backend event handlers (#555)
* Add function to await until prepare is completed * Create BackendEventHandler to synchronously set up event handling
Diffstat (limited to 'ext/bg/js/background-main.js')
-rw-r--r--ext/bg/js/background-main.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/bg/js/background-main.js b/ext/bg/js/background-main.js
index 345b4a77..9dd447c4 100644
--- a/ext/bg/js/background-main.js
+++ b/ext/bg/js/background-main.js
@@ -17,12 +17,15 @@
/* global
* Backend
+ * BackendEventHandler
*/
-(async () => {
+(() => {
const backend = new Backend();
+ const backendEventHandler = new BackendEventHandler(backend);
+ backendEventHandler.prepare();
if (typeof window === 'object' && window !== null) {
window.yomichanBackend = backend;
}
- await backend.prepare();
+ backend.prepare();
})();