No longer creates an empty Promise without any use (async (resolve, reject)=>...).
No longer checks and rechecks whether it's in a timout.
When timeout value is provided, it creates a single delayed rejected promise and uses it with Promise.race when doing operations.
A unique object is used to identify a timeout error. First try was class TimeoutError extends Error {}, but instanceof TimeoutError is false for IE11/Edge.
No longer creates an empty Promise without any use (
async (resolve, reject)=>...
). No longer checks and rechecks whether it's in a timout. When timeout value is provided, it creates a single delayed rejected promise and uses it with Promise.race when doing operations. A unique object is used to identify a timeout error. First try wasclass TimeoutError extends Error {}
, butinstanceof TimeoutError
is false for IE11/Edge.