The hub this listener should attach to.
The channel to subscribe to.
Called with the payload, message, and unsub function when a message is published.
Function that determines if the subscription should be removed.
OptionalincludeMatch: boolean = trueOptionalonlyFuture: boolean = falseIf true, callback will fire only for messages dispatched in the future. If false, messages in the backlog will also be considered.
const hub = new Hub();
until(hub, 'sandwiches', (p) => console.log(`until: ${p}`), (p) => p.includes('reuben'));
hub.pub('sandwiches', 'club sandwich');
// "until: club sandwich"
hub.pub('sandwiches', 'reuben sandwich');
// "until: reuben sandwich"
hub.pub('sandwiches', 'chicken sandwich');
// Nothing printed.
Remove subscription when test evaluates to
true.