UNPKG

@reactivex/ix-es5-esm

Version:

The Interactive Extensions for JavaScript

31 lines (29 loc) 1.21 kB
import { AsyncIterableX } from './asynciterablex.js'; import { Transform } from 'stream'; var asyncIterableMixin = Symbol('asyncIterableMixin'); /** @ignore */ export function AsyncIterableTransform(options) { Transform.call(this, options); // If this is the first time AsyncIterableTransform is being constructed, // mixin the methods from the AsyncIterableX's prototype. if (!AsyncIterableTransform[asyncIterableMixin]) { AsyncIterableTransform[asyncIterableMixin] = true; Object.defineProperties(AsyncIterableTransform.prototype, Object.getOwnPropertyDescriptors(AsyncIterableX.prototype)); } } AsyncIterableTransform.prototype = Object.create(Transform.prototype); AsyncIterableTransform[asyncIterableMixin] = false; /** @nocollapse */ AsyncIterableTransform.prototype._flush = function (callback) { callback(); }; /** @nocollapse */ AsyncIterableTransform.prototype._transform = function (chunk, _encoding, callback) { callback(null, chunk); }; /** @ignore */ export function asAsyncIterable(options) { if (options === void 0) { options = {}; } return Reflect.construct(AsyncIterableTransform, [options]); } //# sourceMappingURL=asasynciterable.js.map