@codibre/fluent-iterable
Version:
Provides LINQ-like fluent api operations for iterables and async iterables (ES2018+).
12 lines (11 loc) • 392 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.whenEmptyAsync = whenEmptyAsync;
const execute_async_1 = require("../async/execute-async");
async function* whenEmptyAsync(fallbackIterable) {
let fallback = true;
yield* execute_async_1.executeAsync.call(this, () => (fallback = false));
if (fallback) {
yield* fallbackIterable;
}
}