Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm2015 / internal / ReplaySubject.js
index 2acf607fef98c79fa8b3774185de0379949d886a..5bc6c760360ffde7fdc850b26bc65a3bfd49d288 100644 (file)
@@ -21,16 +21,20 @@ export class ReplaySubject extends Subject {
         }
     }
     nextInfiniteTimeWindow(value) {
-        const _events = this._events;
-        _events.push(value);
-        if (_events.length > this._bufferSize) {
-            _events.shift();
+        if (!this.isStopped) {
+            const _events = this._events;
+            _events.push(value);
+            if (_events.length > this._bufferSize) {
+                _events.shift();
+            }
         }
         super.next(value);
     }
     nextTimeWindow(value) {
-        this._events.push(new ReplayEvent(this._getNow(), value));
-        this._trimBufferThenGetEvents();
+        if (!this.isStopped) {
+            this._events.push(new ReplayEvent(this._getNow(), value));
+            this._trimBufferThenGetEvents();
+        }
         super.next(value);
     }
     _subscribe(subscriber) {