Rejects with TimeoutError if ms elapses first, or with the external
signal's reason if that aborts first. A function-form operation receives a
signal that aborts on either, so cancellable work stops promptly instead of
merely having its result ignored.
A plain promise cannot be cancelled: timeout only stops waiting for its
result. Prefer the function form for I/O or mutations that accept a signal.
Races work against a timeout.
Rejects with TimeoutError if
mselapses first, or with the external signal's reason if that aborts first. A function-form operation receives a signal that aborts on either, so cancellable work stops promptly instead of merely having its result ignored.A plain promise cannot be cancelled: timeout only stops waiting for its result. Prefer the function form for I/O or mutations that accept a signal.