Skip to content

Instantly share code, notes, and snippets.

@calebporzio
Created July 2, 2024 13:01
Show Gist options
  • Save calebporzio/9e8efeeda572b1c0e43c8faac5e02975 to your computer and use it in GitHub Desktop.
Save calebporzio/9e8efeeda572b1c0e43c8faac5e02975 to your computer and use it in GitHub Desktop.
export function detangle() {
let blocked = false
return callback => (...args) => {
if (blocked) return
blocked = true
callback(...args)
blocked = false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment