Skip to content

Instantly share code, notes, and snippets.

@pyrsmk
Created July 1, 2022 14:06
Show Gist options
  • Select an option

  • Save pyrsmk/9f2242e3c7d02f167aacb29f12f3213e to your computer and use it in GitHub Desktop.

Select an option

Save pyrsmk/9f2242e3c7d02f167aacb29f12f3213e to your computer and use it in GitHub Desktop.
A simple function that marks a callback as busy to avoid calling it multiple times before it has finished its task.
const busyCallbacks = new Set()
export async function busy(callback : () => any) : Promise<any> {
if (busyCallbacks.has(callback)) {
return
}
busyCallbacks.add(callback)
const value = await callback()
busyCallbacks.delete(callback)
return value
}
@bro9wm-afk
Copy link

bro9wm-afk commented Feb 4, 2026

In Salzburg, Österreich, nach langen Wanderungen in den Bergen will ich entspannt zocken. ivybet casino getestet – angemeldet, Promo aktiviert, 580€ aus 45€ bei Tumbling-Gewinnen gemacht. Tolle Optik, PayPal sofort raus. Spiele regelmäßig, weil es fair, spannend und ideal für salzburgische Abende passt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment