UNPKG

@reactivex/ix-es2015-cjs

Version:

The Interactive Extensions for JavaScript

35 lines (33 loc) 1.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.asAsyncIterable = exports.AsyncIterableTransform = void 0; const asynciterablex_js_1 = require("./asynciterablex.js"); const stream_1 = require("stream"); const asyncIterableMixin = Symbol('asyncIterableMixin'); /** @ignore */ function AsyncIterableTransform(options) { stream_1.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_js_1.AsyncIterableX.prototype)); } } exports.AsyncIterableTransform = AsyncIterableTransform; AsyncIterableTransform.prototype = Object.create(stream_1.Transform.prototype); AsyncIterableTransform[asyncIterableMixin] = false; /** @nocollapse */ AsyncIterableTransform.prototype._flush = function (callback) { callback(); }; /** @nocollapse */ AsyncIterableTransform.prototype._transform = function (chunk, _encoding, callback) { callback(null, chunk); }; /** @ignore */ function asAsyncIterable(options = {}) { return Reflect.construct(AsyncIterableTransform, [options]); } exports.asAsyncIterable = asAsyncIterable; //# sourceMappingURL=asasynciterable.js.map