Bluesky app fork with some witchin' additions 馃挮 witchsky.app
bluesky fork client
119
fork

Configure Feed

Select the types of activity you want to include in your feed.

at a876aae44ea07494ebea9727350aa060b81f317b 24 lines 571 B view raw
1type BundledFn<Args extends readonly unknown[], Res> = ( 2 ...args: Args 3) => Promise<Res> 4 5/** 6 * A helper which ensures that multiple calls to an async function 7 * only produces one in-flight request at a time. 8 */ 9export function bundleAsync<Args extends readonly unknown[], Res>( 10 fn: BundledFn<Args, Res>, 11): BundledFn<Args, Res> { 12 let promise: Promise<Res> | undefined 13 return async (...args) => { 14 if (promise) { 15 return promise 16 } 17 promise = fn(...args) 18 try { 19 return await promise 20 } finally { 21 promise = undefined 22 } 23 } 24}