add subject function binders
This commit is contained in:
parent
955d9b9a3f
commit
dc2b0e014f
2 changed files with 9 additions and 1 deletions
|
|
@ -46,4 +46,12 @@ class Broker {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return function bound to a topic
|
||||
bind(topic, message, options) {
|
||||
let broker = this;
|
||||
return function(msg = message, opt = options) {
|
||||
broker.publish(topic, msg, opt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue