You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's some good discussion of considerations and tradeoffs linked from that thread. Something to consider here.
// click-and-drag handlerelement.addEventListener('mousedown',async()=>{forawait(let{ clientX, clientY }ofelement.on('mousemove').takeUntil(element.on('mouseup')){console.log('moved mouse to',clientX,clientY);if(clientX>threshold){break;// triggers `return` handler from the async iterator, which automatically unsubscribes}}console.log('mouse up or exceeded threshold');});