Skip to content

Commit

Permalink
[form-builder] Fix broken batch upload when uploading > 4 entries at …
Browse files Browse the repository at this point in the history
…once (#994)
  • Loading branch information
bjoerge committed Oct 16, 2018
1 parent 7f53c40 commit 72838a5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Takes a observable-returning function and returns a new function that limits on the number of
// concurrent observables.

import {first, mergeMap} from 'rxjs/operators'
import {Subject, Subscription, Observable, from as observableFrom} from 'rxjs'

const DEFAULT_CONCURRENCY = 4
Expand Down Expand Up @@ -34,7 +34,7 @@ export function createThrottler(concurrency: number = DEFAULT_CONCURRENCY) {
return new Observable(observer => {
if (currentSubscriptions.length >= concurrency) {
return scheduleAndWait(observable)
.mergeMap(request)
.pipe(mergeMap(request))
.subscribe(observer)
}
const subscription = observable.subscribe(observer)
Expand All @@ -50,7 +50,7 @@ export function createThrottler(concurrency: number = DEFAULT_CONCURRENCY) {

function scheduleAndWait(observable) {
pendingObservables.push(observable)
return ready$.asObservable().first(obs => obs === observable)
return ready$.asObservable().pipe(first(obs => obs === observable))
}

function check() {
Expand Down

0 comments on commit 72838a5

Please sign in to comment.