Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat req: provide signal opt #768

Closed
antongolub opened this issue Apr 6, 2024 · 0 comments · Fixed by #769
Closed

feat req: provide signal opt #768

antongolub opened this issue Apr 6, 2024 · 0 comments · Fixed by #769

Comments

@antongolub
Copy link
Collaborator

          Why support `ac` instead of `signal`, for which JavaScript has methods to work with?
const p1 = $({ signal: AbortSignal.timeout(100) })`sleep 9999`
 
// and

const ac = new AbortController()
const p2 = $({ 
  signal: AbortSignal.any(AbortSignal.timeout(1000), ac.signal)
})`sleep 9999`

button.addEventListener('click', () => {
  ac.abort()
})

Originally posted by @ftoh in #734 (comment)

antongolub added a commit to antongolub/zx that referenced this issue Apr 6, 2024
antonmedv pushed a commit that referenced this issue Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant