Identical in behavior to latest, but returns a Promise instead of accepting a callback.
The Hub instance to which this will subscribe.
An array of route descriptors (see Hub for details on valid route descriptors).
Time in milliseconds to wait for a message before timing out.
const hub = new Hub();lastAsync(hub, ['sandwich', 'soup'], 1000) .then(r => console.log(`last: ${r}`));hub.pub('sandwich', 'reuben');hub.pub('sandwich', 'club');hub.pub('soup', 'chicken');// "last: [['sandwich', 'club'], ['soup', 'chicken']]" Copy
const hub = new Hub();lastAsync(hub, ['sandwich', 'soup'], 1000) .then(r => console.log(`last: ${r}`));hub.pub('sandwich', 'reuben');hub.pub('sandwich', 'club');hub.pub('soup', 'chicken');// "last: [['sandwich', 'club'], ['soup', 'chicken']]"
Identical in behavior to latest, but returns a Promise instead of accepting a callback.