Typed Async Code

Type async code that keeps its types: deferred promises, timeouts, retries, debounce, concurrency limits and settled tuples.

  1. 01

    Build a Typed Deferred Promise

    • easy
    • Code
  2. 02

    Sleep Until Done or Aborted

    • easy
    • Code
  3. 03

    Time Out a Promise with a Typed Error

    • easy
    • Code
  4. 04

    Retry an Async Call, Keeping Its Result Type

    • easy
    • Code
  5. 05

    Poll Until a Typed Result Is Ready

    • easy
    • Code
  6. 06

    Debounce a Function You Can Cancel, Typed

    • medium
    • Code
  7. 07

    Throttle a Function, Keeping Its Types

    • medium
    • Code
  8. 08

    Run Async Work Exclusively with a Typed Mutex

    • medium
    • Code
  9. 09

    Process Items One at a Time with a Typed Worker

    • medium
    • Code
  10. 10

    Map with a Concurrency Limit, Typed and in Order

    • medium
    • Code
    • Pro
  11. 11

    Share In-Flight Requests per Key, Typed

    • medium
    • Code
    • Pro
  12. 12

    Batch an Async Stream with a Typed Generator

    • medium
    • Code
  13. 13

    Limit Concurrent Work with a Typed Semaphore

    • hard
    • Code
  14. 14

    Settle a Tuple of Promises, Typed per Element

    • hard
    • Code
    • Pro
  15. 15

    Race Named Promises and Know Which Won

    • hard
    • Code
    • Pro