project bootstrap

This commit is contained in:
2023-11-25 18:12:47 -05:00
parent 5cd875ae80
commit 6ef22d88f9
39139 changed files with 4944609 additions and 2 deletions
+20
View File
@@ -0,0 +1,20 @@
module.exports = thunkyp
function thunkyp (fn) {
let running = null
return ready
function ready () {
if (running) return running
const p = fn()
if (!(p instanceof Promise)) running = Promise.resolve(p)
else running = p
running.catch(onerror)
return running
}
function onerror () {
running = null
}
}