Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Race an event against an AbortSignal
Race an event against an AbortSignal, taking care to remove any event listeners that were added.
const { raceEvent } = require('race-event')
const controller = new AbortController()
const emitter = new EventTarget()
setTimeout(() => {
controller.abort()
}, 500)
setTimeout(() => {
// too late
emitter.dispatchEvent(new CustomEvent('event'))
}, 1000)
// throws an AbortError
const resolve = await raceEvent(emitter, 'event', controller.signal)
$ npm i race-event
<script>
tagLoading this module through a script tag will make it's exports available as RaceEvent
in the global namespace.
<script src="https://unpkg.com/race-event/dist/index.min.js"></script>
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
FAQs
Race an event against an AbortSignal
The npm package race-event receives a total of 15,373 weekly downloads. As such, race-event popularity was classified as popular.
We found that race-event demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.