UNPKG

@codibre/fluent-iterable

Version:

Provides LINQ-like fluent api operations for iterables and async iterables (ES2018+).

12 lines (11 loc) 341 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.whenEmpty = whenEmpty; const execute_1 = require("./execute"); function* whenEmpty(fallbackIterable) { let fallback = true; yield* execute_1.execute.call(this, () => (fallback = false)); if (fallback) { yield* fallbackIterable; } }