source: trip-planner-front/node_modules/rxjs/_esm5/internal/operators/buffer.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/** PURE_IMPORTS_START tslib,_innerSubscribe PURE_IMPORTS_END */
2import * as tslib_1 from "tslib";
3import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';
4export function buffer(closingNotifier) {
5 return function bufferOperatorFunction(source) {
6 return source.lift(new BufferOperator(closingNotifier));
7 };
8}
9var BufferOperator = /*@__PURE__*/ (function () {
10 function BufferOperator(closingNotifier) {
11 this.closingNotifier = closingNotifier;
12 }
13 BufferOperator.prototype.call = function (subscriber, source) {
14 return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
15 };
16 return BufferOperator;
17}());
18var BufferSubscriber = /*@__PURE__*/ (function (_super) {
19 tslib_1.__extends(BufferSubscriber, _super);
20 function BufferSubscriber(destination, closingNotifier) {
21 var _this = _super.call(this, destination) || this;
22 _this.buffer = [];
23 _this.add(innerSubscribe(closingNotifier, new SimpleInnerSubscriber(_this)));
24 return _this;
25 }
26 BufferSubscriber.prototype._next = function (value) {
27 this.buffer.push(value);
28 };
29 BufferSubscriber.prototype.notifyNext = function () {
30 var buffer = this.buffer;
31 this.buffer = [];
32 this.destination.next(buffer);
33 };
34 return BufferSubscriber;
35}(SimpleOuterSubscriber));
36//# sourceMappingURL=buffer.js.map
Note: See TracBrowser for help on using the repository browser.