/
eapostnova
/
2026-1--study--mathmod
Обзор
Документация
Войти
/
eapostnova
/
2026-1--study--mathmod
Код
Запросы
0
Задачи
Пакеты
0
Релизы
6
Аналитика
Безопасность
develop
node_modules/rxjs/_esm2015/internal/operators/buffer.js
30 строк
974 B
Елизавета Постнова
feat(lab): lab04
24 мар 2026, 02:59
Верифицирован
24 мар 2026, 02:59
7783508
Код
Авторство
О чём код?
import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe'; 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)); } } class BufferSubscriber extends SimpleOuterSubscriber { constructor(destination, closingNotifier) { super(destination); this.buffer = []; this.add(innerSubscribe(closingNotifier, new SimpleInnerSubscriber(this))); } _next(value) { this.buffer.push(value); } notifyNext() { const buffer = this.buffer; this.buffer = []; this.destination.next(buffer); } } //# sourceMappingURL=buffer.js.map