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

    Function askShouldFetch

    • Decides whether a watch ask, or the phone coming up, should start a fetch.

      An ask that lands while a save's refetch is pending is folded into it, or the two would race and fetch twice. An ask that lands inside the gap after a finished fetch has resend send that reading again, since fetching it again would bring the same reading. Either way the ask counts towards skipping the next slow tick.

      Parameters

      • asks: FeatureAsks

        The ask state to read and update in place.

      • nowMs: number = 0

        The time now, in ms since the epoch. Only read when the asks have a gap.

      • Optionalresend: () => void

        Sends the last reading again, for an ask inside the gap.

      Returns boolean

      True when the ask should start a fetch.