updated approach to deps, mod loading, main entrypoints
This commit is contained in:
parent
70f9146a96
commit
19522665b2
21 changed files with 299 additions and 321 deletions
|
|
@ -2,18 +2,12 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
(function() {
|
||||
|
||||
let moto = self.moto = self.moto || {};
|
||||
|
||||
if (moto.worker) return;
|
||||
|
||||
gapp.register('moto.worker');
|
||||
gapp.register("moto.worker", [], (root, exports) => {
|
||||
|
||||
let endpoints = {};
|
||||
|
||||
// code is running in the worker / server context
|
||||
const dispatch = moto.worker = {
|
||||
const dispatch = exports({
|
||||
|
||||
// bind an endpoint name to a function
|
||||
bind(name, fn) {
|
||||
|
|
@ -100,9 +94,9 @@ const dispatch = moto.worker = {
|
|||
}
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
// attach onmessage hanler
|
||||
self.onmessage = dispatch.onmessage;
|
||||
|
||||
})();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue