@alwaysblank/denden
    Preparing search index...

    Function withHub

    • Returns a version of func which that is bound to hub, and therefore does not need to specify the hub to use.

      Type Parameters

      • Args extends any[]

        Arguments passed to func.

      • R

        Return type of func.

      Parameters

      • hub: Hub

        The Hub instance to which this function will be bound.

      • func: (hub: Hub, ...args: Args) => R

        The function to be bound.

      Returns (...args: Args) => R

      const hub = new Hub();
      latest(hub, callback, 'test', 100);
      // With withHub:
      const waiter = withHub(hub, latest);
      waiter(callback, 'test', 100);