Pebble App Framework: Phone API
    Preparing search index...

    Function fetchQuotes

    • Fetches a quote for each ticker from one provider, all at once, and answers them in order.

      A ticker whose fetch throws, such as a bad URL from odd input or a provider tripping over an odd answer, comes back as ERR rather than ending the round, so every other ticker still answers. The round has no watchdog of its own, so the request it is given has to end every fetch with a timeout of its own.

      Every ticker starts at once, so for a provider that refuses calls close together, as Alpha Vantage's free key does about a second apart, ask for one ticker at a time.

      Parameters

      • symbols: string[]

        The tickers, in the order to answer them.

      • opts: StockOpts

        The provider and its key.

      • request: RequestFn

        The HTTP GET to fetch with.

      Returns Promise<StockQuote[]>

      One quote per ticker, in the order given.