@alwaysblank/denden
    Preparing search index...

    Function latestAsync

    • Identical in behavior to latest, but returns a Promise instead of accepting a callback.

      Type Parameters

      • T

      Parameters

      • hub: Hub

        The Hub instance to which this will subscribe.

      • routes: ChannelRoute[]

        An array of route descriptors (see Hub for details on valid route descriptors).

      • waitTime: number

        Time in milliseconds to wait for a message before timing out.

      Returns Promise<WaitForResults<any>>

      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']]"