add auto function binding
This commit is contained in:
parent
ea830a681a
commit
4acded19aa
4 changed files with 42 additions and 10 deletions
|
|
@ -18,8 +18,9 @@ let endpoints = {};
|
|||
// code is running in the worker / server context
|
||||
const dispatch = moto.worker = {
|
||||
|
||||
register: (name, fn) => {
|
||||
bind: (name, fn) => {
|
||||
endpoints[name] = fn;
|
||||
dispatch.send({bind: name});
|
||||
},
|
||||
|
||||
send: (msg) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue