Created
July 2, 2024 18:55
-
-
Save huynhducduy/d180dc30a21e00ec1da7bb47ff042f4e to your computer and use it in GitHub Desktop.
detangle.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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