Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/queuepro/node_modules/rxjs/_esm2015/operators/ drwxrwxr-x | |
| Viewing file: Select action/file-type: import { OuterSubscriber } from '../OuterSubscriber';
import { subscribeToResult } from '../util/subscribeToResult';
/**
* Buffers the source Observable values until `closingNotifier` emits.
*
* <span class="informal">Collects values from the past as an array, and emits
* that array only when another Observable emits.</span>
*
* <img src="./img/buffer.png" width="100%">
*
* Buffers the incoming Observable values until the given `closingNotifier`
* Observable emits a value, at which point it emits the buffer on the output
* Observable and starts a new buffer internally, awaiting the next time
* `closingNotifier` emits.
*
* @example <caption>On every click, emit array of most recent interval events</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var interval = Rx.Observable.interval(1000);
* var buffered = interval.buffer(clicks);
* buffered.subscribe(x => console.log(x));
*
* @see {@link bufferCount}
* @see {@link bufferTime}
* @see {@link bufferToggle}
* @see {@link bufferWhen}
* @see {@link window}
*
* @param {Observable<any>} closingNotifier An Observable that signals the
* buffer to be emitted on the output Observable.
* @return {Observable<T[]>} An Observable of buffers, which are arrays of
* values.
* @method buffer
* @owner Observable
*/
export function buffer(closingNotifier) {
return function bufferOperatorFunction(source) {
return source.lift(new BufferOperator(closingNotifier));
};
}
class BufferOperator {
constructor(closingNotifier) {
this.closingNotifier = closingNotifier;
}
call(subscriber, source) {
return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
}
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
class BufferSubscriber extends OuterSubscriber {
constructor(destination, closingNotifier) {
super(destination);
this.buffer = [];
this.add(subscribeToResult(this, closingNotifier));
}
_next(value) {
this.buffer.push(value);
}
notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {
const buffer = this.buffer;
this.buffer = [];
this.destination.next(buffer);
}
}
//# sourceMappingURL=buffer.js.map |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0345 ]-- |