add subject function binders

This commit is contained in:
Stewart Allen 2021-12-09 21:55:16 -05:00
commit dc2b0e014f
2 changed files with 9 additions and 1 deletions

View file

@ -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);
}
}
}