parallel rpc batching

This commit is contained in:
gozzy 2022-11-11 02:01:46 +00:00
parent 85a222d93a
commit 61c2865c46
4 changed files with 85 additions and 52 deletions

View file

@ -8,6 +8,12 @@ export * from './stringUtils'
export * from './numberUtils'
export * from './instanceUtils'
export function flattenNArray(arr) {
return arr.reduce((flat, toFlatten) => {
return flat.concat(Array.isArray(toFlatten) ? flattenNArray(toFlatten) : toFlatten)
}, [])
}
export function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms))
}