{"ast":null,"code":"import { Subject } from '../Subject';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { noop } from '../util/noop';\nexport function window(windowBoundaries) {\n  return operate(function (source, subscriber) {\n    var windowSubject = new Subject();\n    subscriber.next(windowSubject.asObservable());\n    var errorHandler = function errorHandler(err) {\n      windowSubject.error(err);\n      subscriber.error(err);\n    };\n    source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n      return windowSubject === null || windowSubject === void 0 ? void 0 : windowSubject.next(value);\n    }, function () {\n      windowSubject.complete();\n      subscriber.complete();\n    }, errorHandler));\n    windowBoundaries.subscribe(createOperatorSubscriber(subscriber, function () {\n      windowSubject.complete();\n      subscriber.next(windowSubject = new Subject());\n    }, noop, errorHandler));\n    return function () {\n      windowSubject === null || windowSubject === void 0 ? void 0 : windowSubject.unsubscribe();\n      windowSubject = null;\n    };\n  });\n}\n//# sourceMappingURL=window.js.map","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}