Avoid scan on the halEvents to return only the buffered events

Scanning on the buffer aggregates all the previous results
pull/8230/head
Oliver Günther 5 years ago
parent 7448599318
commit 316d8484ee
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 5
      frontend/src/app/modules/hal/services/hal-events.service.ts

@ -1,6 +1,6 @@
import {Injectable} from "@angular/core";
import {Observable, Subject} from "rxjs";
import {buffer, debounceTime, filter, scan} from "rxjs/operators";
import {buffer, debounceTime, filter} from "rxjs/operators";
import {HalResource} from "core-app/modules/hal/resources/hal-resource";
import {ResourceChangesetCommit} from "core-app/modules/fields/edit/services/hal-resource-editing.service";
@ -45,8 +45,7 @@ export class HalEventsService {
.events$
.pipe(
filter((event:HalEvent) => event.resourceType === resourceType),
buffer(this.events$.pipe(debounceTime(debounceTimeInMs))),
scan((acc, curr) => acc.concat(curr))
buffer(this.events$.pipe(debounceTime(debounceTimeInMs)))
);
}

Loading…
Cancel
Save