How to use the linq-to-typescript/async.from function in linq-to-typescript

To help you get started, we’ve selected a few linq-to-typescript examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arogozine / LinqToTypeScript / test / TestHelpers.ts View on Github external
export function asAsync(values: T[]) {
    async function *promises() {
        for (const value of values) {
            yield await new Promise((resolve) => setTimeout(() => resolve(value), 10))
        }
    }
    return fromAsync(promises)
}