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

    Function createDedupedSender

    • Wraps a queueSend so the same dict is not sent twice in a row.

      Every push costs a BLE wake whether or not the reading moved, so the JSON of the dict the watch took is kept and a push with the same JSON is dropped. Holding the JSON rather than the dict means each push works it out once. The half worth spelling out is the failure. A send that nacked its way to the retry cap never reached the watch, so what was kept is thrown away and the next push goes out again. Recording it on the way in instead would leave the face blank until the values happened to move.

      Parameters

      • queueSend: QueueSendFn

        The queue every send goes through.

      • label: string

        What to call this sender in the log.

      Returns DedupedSender

      The sender, holding what the watch last took.