Wrapper over Promise.race([...promises])
to identify which condition was met.
Method signature interface is identical to Redux Saga's race({...promiseMap})
method, but without Redux Saga as a requirement. Straight up plain JavaScript async...await
without dependencies. In TypeScript, return type is also identified according to object key provided per Promise instance (in Redux Saga, a key is described as a "label"), so, there is clear indication of which key maps to which expected type of return value.
Method signature:
race({