Subscribes to events on target, returning the event data
from the first event that fires.
By default waits a maximum of 1 minute.
Automatically unsubscribes on success or failure (ie. timeout)
// Event will be data from either event, whichever fires first // Exception is thrown if neither fires within 1 second constevent = awaiteventRace(document.body, [`pointermove`, `pointerdown`], { timeout:1000 });
Subscribes to events on
target
, returning the event data from the first event that fires.By default waits a maximum of 1 minute.
Automatically unsubscribes on success or failure (ie. timeout)