Function enqueue

Enqueue a function to be executed on the next animation frame

If the same Symbol is provided for multiple calls before the next animation frame, only the latest call will be executed (deduplication).

  • Type Parameters

    • T

    Parameters

    • fn: Updater

      function to be executed on the next animation frame; can return updated value , success or void

    • Optionaldedupe: symbol

      Symbol for deduplication; if not provided, a unique Symbol is created ensuring the update is always executed

    Returns Promise<boolean | void | T>