diff --git a/src/operators/take.ts b/src/operators/take.ts index c0ed065a55..38bf60eb56 100644 --- a/src/operators/take.ts +++ b/src/operators/take.ts @@ -30,10 +30,12 @@ export class TakeSubscriber extends Subscriber { } _next(x) { - if (++this.count <= this.total) { + const total = this.total; + if (++this.count <= total) { this.destination.next(x); - } else { - this.destination.complete(); + if (this.count === total) { + this.destination.complete(); + } } } }