@reactive-js/observable
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -17,3 +17,3 @@ "use strict"; | ||
} | ||
complete(error) { | ||
onComplete(error) { | ||
this.ctx.completedCount++; | ||
@@ -28,3 +28,3 @@ if (error !== undefined || this.ctx.completedCount === this.totalCount) { | ||
} | ||
next(data) { | ||
onNext(data) { | ||
if (!this.hasProducedValue) { | ||
@@ -31,0 +31,0 @@ this.ctx.producedCount++; |
@@ -20,4 +20,4 @@ "use strict"; | ||
}; | ||
const next = (v) => subscriber.next(v); | ||
const complete = (error) => { | ||
const onNext = (v) => subscriber.next(v); | ||
const onComplete = (error) => { | ||
subscriber.remove(innerSubscription); | ||
@@ -31,3 +31,3 @@ if (error !== undefined) { | ||
}; | ||
const observer = { next, complete }; | ||
const observer = { onNext, onComplete }; | ||
subscribeNext(); | ||
@@ -34,0 +34,0 @@ }; |
@@ -27,6 +27,4 @@ "use strict"; | ||
const referenceEquality = (a, b) => a === b; | ||
const operator = (equals = referenceEquality) => subscriber => subscriber instanceof rx_1.AbstractDelegatingSubscriber | ||
? new DistinctUntilChangedSubscriber(subscriber, equals) | ||
: subscriber; | ||
const operator = (equals = referenceEquality) => subscriber => new DistinctUntilChangedSubscriber(subscriber, equals); | ||
exports.distinctUntilChanged = (equals) => lift_1.lift(operator(equals)); | ||
//# sourceMappingURL=distinctUntilChanged.js.map |
@@ -8,6 +8,7 @@ "use strict"; | ||
const continuation = shouldYield => { | ||
const length = values.length; | ||
let error = undefined; | ||
try { | ||
const length = values.length; | ||
let index = startIndex; | ||
while (index < length && !subscriber.isDisposed) { | ||
while (index < length && !subscriber.isCompleted) { | ||
const value = values[index]; | ||
@@ -21,9 +22,8 @@ index++; | ||
} | ||
subscriber.complete(); | ||
return; | ||
} | ||
catch (cause) { | ||
subscriber.complete({ cause }); | ||
return; | ||
error = { cause }; | ||
} | ||
subscriber.complete(error); | ||
return; | ||
}; | ||
@@ -51,3 +51,3 @@ const continuationResult = { | ||
const continuation = (shouldYield) => { | ||
while (index < values.length && !subscriber.isDisposed) { | ||
while (index < values.length && !subscriber.isCompleted) { | ||
const [, value] = values[index]; | ||
@@ -54,0 +54,0 @@ index++; |
@@ -12,9 +12,15 @@ "use strict"; | ||
const continuation = shouldYield => { | ||
for (let next = iterator.next(); !next.done && !subscriber.isDisposed; next = iterator.next()) { | ||
subscriber.next(next.value); | ||
if (shouldYield() || delay !== 0) { | ||
return continuationResult; | ||
let error = undefined; | ||
try { | ||
for (let next = iterator.next(); !next.done && !subscriber.isCompleted; next = iterator.next()) { | ||
subscriber.nextUnsafe(next.value); | ||
if (shouldYield() || delay !== 0) { | ||
return continuationResult; | ||
} | ||
} | ||
} | ||
subscriber.complete(); | ||
catch (cause) { | ||
error = { cause }; | ||
} | ||
subscriber.complete(error); | ||
return; | ||
@@ -21,0 +27,0 @@ }; |
@@ -8,3 +8,3 @@ "use strict"; | ||
do { | ||
subscriber.next(acc); | ||
subscriber.nextUnsafe(acc); | ||
try { | ||
@@ -15,6 +15,7 @@ acc = generator(acc); | ||
subscriber.complete({ cause }); | ||
return; | ||
} | ||
} while (!shouldYield() && !subscriber.isDisposed && delay === 0); | ||
return continuationResult; | ||
} while (!shouldYield() && !subscriber.isCompleted && delay === 0); | ||
return subscriber.isCompleted | ||
? undefined | ||
: continuationResult; | ||
}; | ||
@@ -21,0 +22,0 @@ const continuationResult = { |
@@ -14,6 +14,4 @@ "use strict"; | ||
} | ||
const operator = (subscriber) => subscriber instanceof rx_1.AbstractDelegatingSubscriber | ||
? new IgnoreElementsSubscriber(subscriber) | ||
: subscriber; | ||
const operator = (subscriber) => new IgnoreElementsSubscriber(subscriber); | ||
exports.ignoreElements = () => lift_1.lift(operator); | ||
//# sourceMappingURL=ignoreElements.js.map |
@@ -21,3 +21,3 @@ "use strict"; | ||
} | ||
next(x) { | ||
onNext(x) { | ||
if (this._result === undefined) { | ||
@@ -30,3 +30,3 @@ this._result = [x]; | ||
} | ||
complete(x) { | ||
onComplete(x) { | ||
this.error = x; | ||
@@ -65,6 +65,6 @@ } | ||
const observer = { | ||
next: (value) => { | ||
onNext: (value) => { | ||
this.value = [value]; | ||
}, | ||
complete: e => { | ||
onComplete: e => { | ||
this.error = e; | ||
@@ -71,0 +71,0 @@ }, |
@@ -18,6 +18,4 @@ "use strict"; | ||
} | ||
const operator = (mapper) => subscriber => subscriber instanceof rx_1.AbstractDelegatingSubscriber | ||
? new MapSubscriber(subscriber, mapper) | ||
: subscriber; | ||
const operator = (mapper) => subscriber => new MapSubscriber(subscriber, mapper); | ||
exports.map = (mapper) => lift_1.lift(operator(mapper)); | ||
//# sourceMappingURL=map.js.map |
@@ -15,3 +15,3 @@ "use strict"; | ||
} | ||
complete(error) { | ||
onComplete(error) { | ||
this.completedCountRef[0]++; | ||
@@ -26,3 +26,3 @@ if (error !== undefined || this.completedCountRef[0] === this.totalCount) { | ||
} | ||
next(data) { | ||
onNext(data) { | ||
this.delegate.next(data); | ||
@@ -29,0 +29,0 @@ } |
@@ -7,2 +7,3 @@ "use strict"; | ||
const pipe_1 = require("@reactive-js/pipe"); | ||
const disposable_1 = require("@reactive-js/disposable"); | ||
class MergeSubscriber extends rx_1.AbstractDelegatingSubscriber { | ||
@@ -12,13 +13,13 @@ constructor(delegate, maxBufferSize, maxConcurrency) { | ||
this.activeCount = 0; | ||
this.isCompleted = false; | ||
this.queue = []; | ||
this.subscriptions = disposable_1.createDisposable().add(() => { | ||
this.queue.length = 0; | ||
}); | ||
this.maxBufferSize = maxBufferSize; | ||
this.maxConcurrency = maxConcurrency; | ||
this.add(() => { | ||
this.queue.length = 0; | ||
}); | ||
this.add(this.subscriptions); | ||
} | ||
completeUnsafe(error) { | ||
this.isCompleted = true; | ||
if (error !== undefined || this.queue.length + this.activeCount === 0) { | ||
this.subscriptions.dispose(); | ||
this.delegate.complete(error); | ||
@@ -40,11 +41,15 @@ } | ||
const nextObsSubscription = pipe_1.pipe(nextObs, observe_1.observe({ | ||
next: (data) => { | ||
onNext: (data) => { | ||
this.delegate.next(data); | ||
}, | ||
complete: (error) => { | ||
onComplete: (error) => { | ||
this.activeCount--; | ||
this.remove(nextObsSubscription); | ||
this.subscriptions.remove(nextObsSubscription); | ||
if (error !== undefined) { | ||
this.isCompleted = true; | ||
this.delegate.complete(error); | ||
if (!this.isCompleted) { | ||
this.complete(error); | ||
} | ||
else { | ||
this.completeUnsafe(error); | ||
} | ||
} | ||
@@ -56,3 +61,3 @@ else { | ||
}), rx_1.subscribe(this)); | ||
this.add(nextObsSubscription); | ||
this.subscriptions.add(nextObsSubscription); | ||
} | ||
@@ -59,0 +64,0 @@ else if (this.isCompleted) { |
@@ -11,11 +11,8 @@ "use strict"; | ||
completeUnsafe(error) { | ||
this.observer.complete(error); | ||
this.observer.onComplete(error); | ||
this.delegate.complete(error); | ||
} | ||
nextUnsafe(data) { | ||
this.observer.next(data); | ||
if (this.delegate.nextUnsafe !== | ||
undefined) { | ||
this.delegate.nextUnsafe(data); | ||
} | ||
this.observer.onNext(data); | ||
this.delegate.nextUnsafe(data); | ||
} | ||
@@ -27,8 +24,8 @@ } | ||
exports.onComplete = (onComplete) => exports.observe({ | ||
next: ignore, | ||
complete: onComplete, | ||
onNext: ignore, | ||
onComplete, | ||
}); | ||
exports.onError = (onError) => exports.observe({ | ||
next: ignore, | ||
complete: (error) => { | ||
onNext: ignore, | ||
onComplete: (error) => { | ||
if (error !== undefined) { | ||
@@ -41,5 +38,5 @@ const { cause } = error; | ||
exports.onNext = (onNext) => exports.observe({ | ||
next: onNext, | ||
complete: ignore, | ||
onNext, | ||
onComplete: ignore, | ||
}); | ||
//# sourceMappingURL=observe.js.map |
@@ -13,8 +13,8 @@ "use strict"; | ||
if (!disposable.isDisposed) { | ||
observer.next(v); | ||
observer.complete(); | ||
observer.onNext(v); | ||
observer.onComplete(); | ||
} | ||
}, cause => { | ||
if (!disposable.isDisposed) { | ||
observer.complete({ cause }); | ||
observer.onComplete({ cause }); | ||
} | ||
@@ -34,3 +34,3 @@ }) | ||
} | ||
next(x) { | ||
onNext(x) { | ||
if (this.result === undefined) { | ||
@@ -43,3 +43,3 @@ this.result = [x]; | ||
} | ||
complete(err) { | ||
onComplete(err) { | ||
this.subscription.dispose(); | ||
@@ -46,0 +46,0 @@ if (err !== undefined) { |
@@ -13,3 +13,3 @@ "use strict"; | ||
if (error === undefined) { | ||
this.delegate.next(this.acc); | ||
this.delegate.nextUnsafe(this.acc); | ||
} | ||
@@ -16,0 +16,0 @@ this.delegate.complete(error); |
@@ -18,6 +18,6 @@ "use strict"; | ||
completeUnsafe(error) { | ||
this.observer.complete(error); | ||
this.observer.onComplete(error); | ||
} | ||
nextUnsafe(data) { | ||
this.observer.next(data); | ||
this.observer.onNext(data); | ||
} | ||
@@ -30,3 +30,3 @@ } | ||
} | ||
complete(error) { | ||
onComplete(error) { | ||
let shouldComplete = false; | ||
@@ -48,3 +48,3 @@ try { | ||
} | ||
next(data) { | ||
onNext(data) { | ||
this.parent.delegate.next(data); | ||
@@ -51,0 +51,0 @@ } |
@@ -34,4 +34,4 @@ "use strict"; | ||
const subject = this.subject; | ||
const innerSubscription = pipe_1.pipe(subject, observe_1.observe(subscriber), rx_1.subscribe(subscriber)); | ||
subscriber.add(this.teardown, innerSubscription); | ||
subject.subscribe(subscriber); | ||
subscriber.add(this.teardown); | ||
} | ||
@@ -38,0 +38,0 @@ } |
@@ -26,3 +26,3 @@ "use strict"; | ||
} | ||
complete(error) { | ||
onComplete(error) { | ||
if (error !== undefined) { | ||
@@ -32,3 +32,3 @@ this.parent.complete(error); | ||
} | ||
next(data) { | ||
onNext(data) { | ||
this.parent.delegate.next(data); | ||
@@ -35,0 +35,0 @@ } |
@@ -17,6 +17,6 @@ "use strict"; | ||
if (this.count < this.maxCount) { | ||
this.delegate.next(data); | ||
this.delegate.nextUnsafe(data); | ||
} | ||
else if (this.count === this.maxCount) { | ||
this.delegate.complete(); | ||
this.complete(); | ||
} | ||
@@ -23,0 +23,0 @@ } |
@@ -10,3 +10,3 @@ "use strict"; | ||
this.drainQueue = shouldYield => { | ||
while (this.last.length > 0) { | ||
while (this.last.length > 0 && !this.delegate.isCompleted) { | ||
const next = this.last.shift(); | ||
@@ -13,0 +13,0 @@ this.delegate.next(next); |
@@ -15,3 +15,3 @@ "use strict"; | ||
if (this.predicate(data)) { | ||
this.delegate.next(data); | ||
this.delegate.nextUnsafe(data); | ||
} | ||
@@ -18,0 +18,0 @@ else { |
@@ -23,3 +23,3 @@ "use strict"; | ||
this.durationSubscription.disposable = pipe_1.pipe(this.duration, observe_1.onComplete(error => this.complete(error)), rx_1.subscribe(this)); | ||
this.delegate.next(data); | ||
this.delegate.nextUnsafe(data); | ||
} | ||
@@ -26,0 +26,0 @@ } |
@@ -30,3 +30,3 @@ "use strict"; | ||
} | ||
complete(error) { | ||
onComplete(error) { | ||
if (error !== undefined) { | ||
@@ -36,3 +36,3 @@ this.parent.complete(error); | ||
} | ||
next(data) { | ||
onNext(data) { | ||
if (this.parent.otherLatest === undefined) { | ||
@@ -46,6 +46,4 @@ this.parent.otherLatest = [data]; | ||
}; | ||
const operator = (other, selector) => subscriber => subscriber instanceof rx_1.AbstractDelegatingSubscriber | ||
? new WithLatestFromSubscriber(subscriber, other, selector) | ||
: subscriber; | ||
const operator = (other, selector) => subscriber => new WithLatestFromSubscriber(subscriber, other, selector); | ||
exports.withLatestFrom = (other, selector) => lift_1.lift(operator(other, selector)); | ||
//# sourceMappingURL=withLatestFrom.js.map |
@@ -15,3 +15,3 @@ import { subscribe, } from "@reactive-js/rx"; | ||
} | ||
complete(error) { | ||
onComplete(error) { | ||
this.ctx.completedCount++; | ||
@@ -26,3 +26,3 @@ if (error !== undefined || this.ctx.completedCount === this.totalCount) { | ||
} | ||
next(data) { | ||
onNext(data) { | ||
if (!this.hasProducedValue) { | ||
@@ -29,0 +29,0 @@ this.ctx.producedCount++; |
@@ -18,4 +18,4 @@ import { disposed } from "@reactive-js/disposable"; | ||
}; | ||
const next = (v) => subscriber.next(v); | ||
const complete = (error) => { | ||
const onNext = (v) => subscriber.next(v); | ||
const onComplete = (error) => { | ||
subscriber.remove(innerSubscription); | ||
@@ -29,3 +29,3 @@ if (error !== undefined) { | ||
}; | ||
const observer = { next, complete }; | ||
const observer = { onNext, onComplete }; | ||
subscribeNext(); | ||
@@ -32,0 +32,0 @@ }; |
@@ -25,6 +25,4 @@ import { AbstractDelegatingSubscriber, } from "@reactive-js/rx"; | ||
const referenceEquality = (a, b) => a === b; | ||
const operator = (equals = referenceEquality) => subscriber => subscriber instanceof AbstractDelegatingSubscriber | ||
? new DistinctUntilChangedSubscriber(subscriber, equals) | ||
: subscriber; | ||
const operator = (equals = referenceEquality) => subscriber => new DistinctUntilChangedSubscriber(subscriber, equals); | ||
export const distinctUntilChanged = (equals) => lift(operator(equals)); | ||
//# sourceMappingURL=distinctUntilChanged.js.map |
@@ -6,6 +6,7 @@ import { AbstractDelegatingSubscriber } from "@reactive-js/rx"; | ||
const continuation = shouldYield => { | ||
const length = values.length; | ||
let error = undefined; | ||
try { | ||
const length = values.length; | ||
let index = startIndex; | ||
while (index < length && !subscriber.isDisposed) { | ||
while (index < length && !subscriber.isCompleted) { | ||
const value = values[index]; | ||
@@ -19,9 +20,8 @@ index++; | ||
} | ||
subscriber.complete(); | ||
return; | ||
} | ||
catch (cause) { | ||
subscriber.complete({ cause }); | ||
return; | ||
error = { cause }; | ||
} | ||
subscriber.complete(error); | ||
return; | ||
}; | ||
@@ -49,3 +49,3 @@ const continuationResult = { | ||
const continuation = (shouldYield) => { | ||
while (index < values.length && !subscriber.isDisposed) { | ||
while (index < values.length && !subscriber.isCompleted) { | ||
const [, value] = values[index]; | ||
@@ -52,0 +52,0 @@ index++; |
@@ -10,9 +10,15 @@ export const fromIterable = (iterable, delay = 0) => { | ||
const continuation = shouldYield => { | ||
for (let next = iterator.next(); !next.done && !subscriber.isDisposed; next = iterator.next()) { | ||
subscriber.next(next.value); | ||
if (shouldYield() || delay !== 0) { | ||
return continuationResult; | ||
let error = undefined; | ||
try { | ||
for (let next = iterator.next(); !next.done && !subscriber.isCompleted; next = iterator.next()) { | ||
subscriber.nextUnsafe(next.value); | ||
if (shouldYield() || delay !== 0) { | ||
return continuationResult; | ||
} | ||
} | ||
} | ||
subscriber.complete(); | ||
catch (cause) { | ||
error = { cause }; | ||
} | ||
subscriber.complete(error); | ||
return; | ||
@@ -19,0 +25,0 @@ }; |
@@ -6,3 +6,3 @@ export const generate = (generator, initialValue, delay = 0) => { | ||
do { | ||
subscriber.next(acc); | ||
subscriber.nextUnsafe(acc); | ||
try { | ||
@@ -13,6 +13,7 @@ acc = generator(acc); | ||
subscriber.complete({ cause }); | ||
return; | ||
} | ||
} while (!shouldYield() && !subscriber.isDisposed && delay === 0); | ||
return continuationResult; | ||
} while (!shouldYield() && !subscriber.isCompleted && delay === 0); | ||
return subscriber.isCompleted | ||
? undefined | ||
: continuationResult; | ||
}; | ||
@@ -19,0 +20,0 @@ const continuationResult = { |
@@ -12,6 +12,4 @@ import { AbstractDelegatingSubscriber, } from "@reactive-js/rx"; | ||
} | ||
const operator = (subscriber) => subscriber instanceof AbstractDelegatingSubscriber | ||
? new IgnoreElementsSubscriber(subscriber) | ||
: subscriber; | ||
const operator = (subscriber) => new IgnoreElementsSubscriber(subscriber); | ||
export const ignoreElements = () => lift(operator); | ||
//# sourceMappingURL=ignoreElements.js.map |
@@ -19,3 +19,3 @@ import { subscribe, } from "@reactive-js/rx"; | ||
} | ||
next(x) { | ||
onNext(x) { | ||
if (this._result === undefined) { | ||
@@ -28,3 +28,3 @@ this._result = [x]; | ||
} | ||
complete(x) { | ||
onComplete(x) { | ||
this.error = x; | ||
@@ -63,6 +63,6 @@ } | ||
const observer = { | ||
next: (value) => { | ||
onNext: (value) => { | ||
this.value = [value]; | ||
}, | ||
complete: e => { | ||
onComplete: e => { | ||
this.error = e; | ||
@@ -69,0 +69,0 @@ }, |
@@ -16,6 +16,4 @@ import { AbstractDelegatingSubscriber, } from "@reactive-js/rx"; | ||
} | ||
const operator = (mapper) => subscriber => subscriber instanceof AbstractDelegatingSubscriber | ||
? new MapSubscriber(subscriber, mapper) | ||
: subscriber; | ||
const operator = (mapper) => subscriber => new MapSubscriber(subscriber, mapper); | ||
export const map = (mapper) => lift(operator(mapper)); | ||
//# sourceMappingURL=map.js.map |
@@ -13,3 +13,3 @@ import { createDisposable, disposed, } from "@reactive-js/disposable"; | ||
} | ||
complete(error) { | ||
onComplete(error) { | ||
this.completedCountRef[0]++; | ||
@@ -24,3 +24,3 @@ if (error !== undefined || this.completedCountRef[0] === this.totalCount) { | ||
} | ||
next(data) { | ||
onNext(data) { | ||
this.delegate.next(data); | ||
@@ -27,0 +27,0 @@ } |
@@ -5,2 +5,3 @@ import { subscribe, AbstractDelegatingSubscriber, } from "@reactive-js/rx"; | ||
import { pipe } from "@reactive-js/pipe"; | ||
import { createDisposable } from "@reactive-js/disposable"; | ||
class MergeSubscriber extends AbstractDelegatingSubscriber { | ||
@@ -10,13 +11,13 @@ constructor(delegate, maxBufferSize, maxConcurrency) { | ||
this.activeCount = 0; | ||
this.isCompleted = false; | ||
this.queue = []; | ||
this.subscriptions = createDisposable().add(() => { | ||
this.queue.length = 0; | ||
}); | ||
this.maxBufferSize = maxBufferSize; | ||
this.maxConcurrency = maxConcurrency; | ||
this.add(() => { | ||
this.queue.length = 0; | ||
}); | ||
this.add(this.subscriptions); | ||
} | ||
completeUnsafe(error) { | ||
this.isCompleted = true; | ||
if (error !== undefined || this.queue.length + this.activeCount === 0) { | ||
this.subscriptions.dispose(); | ||
this.delegate.complete(error); | ||
@@ -38,11 +39,15 @@ } | ||
const nextObsSubscription = pipe(nextObs, observe({ | ||
next: (data) => { | ||
onNext: (data) => { | ||
this.delegate.next(data); | ||
}, | ||
complete: (error) => { | ||
onComplete: (error) => { | ||
this.activeCount--; | ||
this.remove(nextObsSubscription); | ||
this.subscriptions.remove(nextObsSubscription); | ||
if (error !== undefined) { | ||
this.isCompleted = true; | ||
this.delegate.complete(error); | ||
if (!this.isCompleted) { | ||
this.complete(error); | ||
} | ||
else { | ||
this.completeUnsafe(error); | ||
} | ||
} | ||
@@ -54,3 +59,3 @@ else { | ||
}), subscribe(this)); | ||
this.add(nextObsSubscription); | ||
this.subscriptions.add(nextObsSubscription); | ||
} | ||
@@ -57,0 +62,0 @@ else if (this.isCompleted) { |
@@ -9,11 +9,8 @@ import { AbstractDelegatingSubscriber, } from "@reactive-js/rx"; | ||
completeUnsafe(error) { | ||
this.observer.complete(error); | ||
this.observer.onComplete(error); | ||
this.delegate.complete(error); | ||
} | ||
nextUnsafe(data) { | ||
this.observer.next(data); | ||
if (this.delegate.nextUnsafe !== | ||
undefined) { | ||
this.delegate.nextUnsafe(data); | ||
} | ||
this.observer.onNext(data); | ||
this.delegate.nextUnsafe(data); | ||
} | ||
@@ -25,8 +22,8 @@ } | ||
export const onComplete = (onComplete) => observe({ | ||
next: ignore, | ||
complete: onComplete, | ||
onNext: ignore, | ||
onComplete, | ||
}); | ||
export const onError = (onError) => observe({ | ||
next: ignore, | ||
complete: (error) => { | ||
onNext: ignore, | ||
onComplete: (error) => { | ||
if (error !== undefined) { | ||
@@ -39,5 +36,5 @@ const { cause } = error; | ||
export const onNext = (onNext) => observe({ | ||
next: onNext, | ||
complete: ignore, | ||
onNext, | ||
onComplete: ignore, | ||
}); | ||
//# sourceMappingURL=observe.js.map |
@@ -11,8 +11,8 @@ import { subscribe, createObservable, } from "@reactive-js/rx"; | ||
if (!disposable.isDisposed) { | ||
observer.next(v); | ||
observer.complete(); | ||
observer.onNext(v); | ||
observer.onComplete(); | ||
} | ||
}, cause => { | ||
if (!disposable.isDisposed) { | ||
observer.complete({ cause }); | ||
observer.onComplete({ cause }); | ||
} | ||
@@ -32,3 +32,3 @@ }) | ||
} | ||
next(x) { | ||
onNext(x) { | ||
if (this.result === undefined) { | ||
@@ -41,3 +41,3 @@ this.result = [x]; | ||
} | ||
complete(err) { | ||
onComplete(err) { | ||
this.subscription.dispose(); | ||
@@ -44,0 +44,0 @@ if (err !== undefined) { |
@@ -11,3 +11,3 @@ import { AbstractDelegatingSubscriber, } from "@reactive-js/rx"; | ||
if (error === undefined) { | ||
this.delegate.next(this.acc); | ||
this.delegate.nextUnsafe(this.acc); | ||
} | ||
@@ -14,0 +14,0 @@ this.delegate.complete(error); |
@@ -16,6 +16,6 @@ import { createSerialDisposable, } from "@reactive-js/disposable"; | ||
completeUnsafe(error) { | ||
this.observer.complete(error); | ||
this.observer.onComplete(error); | ||
} | ||
nextUnsafe(data) { | ||
this.observer.next(data); | ||
this.observer.onNext(data); | ||
} | ||
@@ -28,3 +28,3 @@ } | ||
} | ||
complete(error) { | ||
onComplete(error) { | ||
let shouldComplete = false; | ||
@@ -46,3 +46,3 @@ try { | ||
} | ||
next(data) { | ||
onNext(data) { | ||
this.parent.delegate.next(data); | ||
@@ -49,0 +49,0 @@ } |
@@ -32,4 +32,4 @@ import { disposed } from "@reactive-js/disposable"; | ||
const subject = this.subject; | ||
const innerSubscription = pipe(subject, observe(subscriber), subscribe(subscriber)); | ||
subscriber.add(this.teardown, innerSubscription); | ||
subject.subscribe(subscriber); | ||
subscriber.add(this.teardown); | ||
} | ||
@@ -36,0 +36,0 @@ } |
@@ -24,3 +24,3 @@ import { createSerialDisposable } from "@reactive-js/disposable"; | ||
} | ||
complete(error) { | ||
onComplete(error) { | ||
if (error !== undefined) { | ||
@@ -30,3 +30,3 @@ this.parent.complete(error); | ||
} | ||
next(data) { | ||
onNext(data) { | ||
this.parent.delegate.next(data); | ||
@@ -33,0 +33,0 @@ } |
@@ -15,6 +15,6 @@ import { AbstractDelegatingSubscriber, } from "@reactive-js/rx"; | ||
if (this.count < this.maxCount) { | ||
this.delegate.next(data); | ||
this.delegate.nextUnsafe(data); | ||
} | ||
else if (this.count === this.maxCount) { | ||
this.delegate.complete(); | ||
this.complete(); | ||
} | ||
@@ -21,0 +21,0 @@ } |
@@ -8,3 +8,3 @@ import { AbstractDelegatingSubscriber, } from "@reactive-js/rx"; | ||
this.drainQueue = shouldYield => { | ||
while (this.last.length > 0) { | ||
while (this.last.length > 0 && !this.delegate.isCompleted) { | ||
const next = this.last.shift(); | ||
@@ -11,0 +11,0 @@ this.delegate.next(next); |
@@ -13,3 +13,3 @@ import { AbstractDelegatingSubscriber, } from "@reactive-js/rx"; | ||
if (this.predicate(data)) { | ||
this.delegate.next(data); | ||
this.delegate.nextUnsafe(data); | ||
} | ||
@@ -16,0 +16,0 @@ else { |
@@ -21,3 +21,3 @@ import { createSerialDisposable, } from "@reactive-js/disposable"; | ||
this.durationSubscription.disposable = pipe(this.duration, onComplete(error => this.complete(error)), subscribe(this)); | ||
this.delegate.next(data); | ||
this.delegate.nextUnsafe(data); | ||
} | ||
@@ -24,0 +24,0 @@ } |
@@ -28,3 +28,3 @@ import { subscribe, AbstractDelegatingSubscriber, } from "@reactive-js/rx"; | ||
} | ||
complete(error) { | ||
onComplete(error) { | ||
if (error !== undefined) { | ||
@@ -34,3 +34,3 @@ this.parent.complete(error); | ||
} | ||
next(data) { | ||
onNext(data) { | ||
if (this.parent.otherLatest === undefined) { | ||
@@ -44,6 +44,4 @@ this.parent.otherLatest = [data]; | ||
}; | ||
const operator = (other, selector) => subscriber => subscriber instanceof AbstractDelegatingSubscriber | ||
? new WithLatestFromSubscriber(subscriber, other, selector) | ||
: subscriber; | ||
const operator = (other, selector) => subscriber => new WithLatestFromSubscriber(subscriber, other, selector); | ||
export const withLatestFrom = (other, selector) => lift(operator(other, selector)); | ||
//# sourceMappingURL=withLatestFrom.js.map |
{ | ||
"name": "@reactive-js/observable", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"main": "dist/cjs/index.js", | ||
@@ -41,7 +41,7 @@ "module": "dist/esm5/index.js", | ||
"dependencies": { | ||
"@reactive-js/disposable": "^0.0.13", | ||
"@reactive-js/pipe": "^0.0.13", | ||
"@reactive-js/rx": "^0.0.13", | ||
"@reactive-js/scheduler": "^0.0.13", | ||
"@reactive-js/schedulers": "^0.0.13" | ||
"@reactive-js/disposable": "^0.0.14", | ||
"@reactive-js/pipe": "^0.0.14", | ||
"@reactive-js/rx": "^0.0.14", | ||
"@reactive-js/scheduler": "^0.0.14", | ||
"@reactive-js/schedulers": "^0.0.14" | ||
}, | ||
@@ -73,3 +73,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "86211c5e64b3702b5e3b00dc31d40a79f35bd02f" | ||
"gitHead": "8a86dc5efc38fdfe6683765bf2ff3eb14f3820de" | ||
} |
@@ -44,3 +44,3 @@ import { | ||
complete(error?: ErrorLike) { | ||
onComplete(error?: ErrorLike) { | ||
this.ctx.completedCount++; | ||
@@ -57,3 +57,3 @@ | ||
next(data: any) { | ||
onNext(data: any) { | ||
if (!this.hasProducedValue) { | ||
@@ -60,0 +60,0 @@ this.ctx.producedCount++; |
@@ -42,5 +42,5 @@ import { disposed } from "@reactive-js/disposable"; | ||
const next = (v: T) => subscriber.next(v); | ||
const onNext = (v: T) => subscriber.next(v); | ||
const complete = (error?: ErrorLike) => { | ||
const onComplete = (error?: ErrorLike) => { | ||
subscriber.remove(innerSubscription); | ||
@@ -55,3 +55,3 @@ | ||
const observer = { next, complete }; | ||
const observer = { onNext, onComplete }; | ||
@@ -58,0 +58,0 @@ subscribeNext(); |
@@ -35,6 +35,4 @@ import { | ||
// Performance: Bypass safety checks and directly | ||
// sink notifcations to the delegate. | ||
(this.delegate as AbstractDelegatingSubscriber<T, unknown>).nextUnsafe( | ||
data, | ||
); | ||
// sink notifications to the delegate. | ||
this.delegate.nextUnsafe(data); | ||
} | ||
@@ -49,5 +47,3 @@ } | ||
): SubscriberOperatorLike<T, T> => subscriber => | ||
subscriber instanceof AbstractDelegatingSubscriber | ||
? new DistinctUntilChangedSubscriber(subscriber, equals) | ||
: subscriber; | ||
new DistinctUntilChangedSubscriber(subscriber, equals); | ||
@@ -54,0 +50,0 @@ export const distinctUntilChanged = <T>( |
@@ -14,8 +14,10 @@ import { ObservableLike, SubscriberLike, AbstractDelegatingSubscriber } from "@reactive-js/rx"; | ||
const continuation: SchedulerContinuationLike = shouldYield => { | ||
const continuation: SchedulerContinuationLike = shouldYield => { | ||
const length = values.length; | ||
let error = undefined; | ||
try { | ||
const length = values.length; | ||
let index = startIndex; | ||
while (index < length && !subscriber.isDisposed) { | ||
while (index < length && !subscriber.isCompleted) { | ||
const value = values[index]; | ||
@@ -26,3 +28,3 @@ index++; | ||
// sink notifications to the delegate. | ||
(subscriber as AbstractDelegatingSubscriber<T, unknown>).nextUnsafe(value); | ||
subscriber.nextUnsafe(value); | ||
@@ -34,9 +36,8 @@ if (shouldYield() || delay > 0) { | ||
} | ||
subscriber.complete(); | ||
return; | ||
} catch (cause) { | ||
subscriber.complete({ cause }); | ||
return; | ||
error = { cause }; | ||
} | ||
subscriber.complete(error); | ||
return; | ||
}; | ||
@@ -79,3 +80,3 @@ const continuationResult: SchedulerContinuationResultLike = { | ||
) => { | ||
while (index < values.length && !subscriber.isDisposed) { | ||
while (index < values.length && !subscriber.isCompleted) { | ||
const [, value] = values[index]; | ||
@@ -82,0 +83,0 @@ index++; |
@@ -21,15 +21,21 @@ import { ObservableLike, SubscriberLike } from "@reactive-js/rx"; | ||
const continuation: SchedulerContinuationLike = shouldYield => { | ||
for ( | ||
let next = iterator.next(); | ||
!next.done && !subscriber.isDisposed; | ||
next = iterator.next() | ||
) { | ||
subscriber.next(next.value); | ||
let error = undefined; | ||
if (shouldYield() || delay !== 0) { | ||
return continuationResult; | ||
try{ | ||
for ( | ||
let next = iterator.next(); | ||
!next.done && !subscriber.isCompleted; | ||
next = iterator.next() | ||
) { | ||
subscriber.nextUnsafe(next.value); | ||
if (shouldYield() || delay !== 0) { | ||
return continuationResult; | ||
} | ||
} | ||
} catch (cause) { | ||
error = { cause }; | ||
} | ||
subscriber.complete(); | ||
subscriber.complete(error); | ||
return; | ||
@@ -36,0 +42,0 @@ }; |
@@ -19,4 +19,3 @@ import { ObservableLike, SubscriberLike } from "@reactive-js/rx"; | ||
do { | ||
subscriber.next(acc); | ||
subscriber.nextUnsafe(acc); | ||
try { | ||
@@ -26,7 +25,8 @@ acc = generator(acc); | ||
subscriber.complete({ cause }); | ||
return; | ||
} | ||
} while (!shouldYield() && !subscriber.isDisposed && delay === 0); | ||
return continuationResult; | ||
} while (!shouldYield() && !subscriber.isCompleted && delay === 0); | ||
return subscriber.isCompleted | ||
? undefined | ||
: continuationResult; | ||
}; | ||
@@ -33,0 +33,0 @@ const continuationResult: SchedulerContinuationResultLike = { |
@@ -25,7 +25,5 @@ import { | ||
const operator = <TA, TB>(subscriber: SubscriberLike<TB>) => | ||
subscriber instanceof AbstractDelegatingSubscriber | ||
? new IgnoreElementsSubscriber<TA, TB>(subscriber) | ||
: subscriber; | ||
new IgnoreElementsSubscriber<TA, TB>(subscriber); | ||
export const ignoreElements = <TA, TB>(): ObservableOperatorLike<TA, TB> => | ||
lift(operator); |
@@ -31,3 +31,3 @@ import { | ||
next(x: T) { | ||
onNext(x: T) { | ||
if (this._result === undefined) { | ||
@@ -40,3 +40,3 @@ this._result = [x]; | ||
complete(x?: ErrorLike) { | ||
onComplete(x?: ErrorLike) { | ||
this.error = x; | ||
@@ -100,6 +100,6 @@ } | ||
const observer: ObserverLike<T> = { | ||
next: (value: T) => { | ||
onNext: (value: T) => { | ||
this.value = [value]; | ||
}, | ||
complete: e => { | ||
onComplete: e => { | ||
this.error = e; | ||
@@ -106,0 +106,0 @@ }, |
@@ -11,2 +11,3 @@ import { | ||
private readonly predicate: (data: T) => boolean; | ||
constructor(delegate: SubscriberLike<T>, predicate: (data: T) => boolean) { | ||
@@ -25,6 +26,4 @@ super(delegate); | ||
// Performance: Bypass safety checks and directly | ||
// sink notifcations to the delegate. | ||
(this.delegate as AbstractDelegatingSubscriber<T, unknown>).nextUnsafe( | ||
data, | ||
); | ||
// sink notifications to the delegate. | ||
this.delegate.nextUnsafe(data); | ||
} | ||
@@ -31,0 +30,0 @@ } |
@@ -10,3 +10,3 @@ import { | ||
class MapSubscriber<TA, TB> extends AbstractDelegatingSubscriber<TA, TB> { | ||
private readonly mapper: (data: TA) => TB; | ||
readonly mapper: (data: TA) => TB; | ||
constructor(delegate: SubscriberLike<TB>, mapper: (data: TA) => TB) { | ||
@@ -25,6 +25,4 @@ super(delegate); | ||
// Performance: Bypass safety checks and directly | ||
// sink notifcations to the delegate. | ||
(this.delegate as AbstractDelegatingSubscriber<TB, unknown>).nextUnsafe( | ||
mappedData, | ||
); | ||
// sink notifications to the delegate. | ||
this.delegate.nextUnsafe(mappedData); | ||
} | ||
@@ -36,5 +34,3 @@ } | ||
): SubscriberOperatorLike<TA, TB> => subscriber => | ||
subscriber instanceof AbstractDelegatingSubscriber | ||
? new MapSubscriber(subscriber, mapper) | ||
: (subscriber as SubscriberLike<any>); | ||
new MapSubscriber(subscriber, mapper); | ||
@@ -41,0 +37,0 @@ export const map = <TA, TB>( |
@@ -34,3 +34,3 @@ import { | ||
complete(error?: ErrorLike) { | ||
onComplete(error?: ErrorLike) { | ||
this.completedCountRef[0]++; | ||
@@ -47,3 +47,3 @@ | ||
next(data: T) { | ||
onNext(data: T) { | ||
this.delegate.next(data); | ||
@@ -50,0 +50,0 @@ } |
@@ -12,2 +12,3 @@ import { | ||
import { pipe } from "@reactive-js/pipe"; | ||
import { createDisposable } from "@reactive-js/disposable"; | ||
@@ -19,6 +20,12 @@ class MergeSubscriber<T> extends AbstractDelegatingSubscriber< | ||
private activeCount = 0; | ||
private isCompleted = false; | ||
private readonly maxBufferSize: number; | ||
private readonly maxConcurrency: number; | ||
private readonly queue: Array<ObservableLike<T>> = []; | ||
private readonly subscriptions = createDisposable().add( | ||
() => { | ||
this.queue.length = 0; | ||
} | ||
); | ||
constructor( | ||
@@ -33,11 +40,8 @@ delegate: SubscriberLike<T>, | ||
this.add(() => { | ||
this.queue.length = 0; | ||
}); | ||
this.add(this.subscriptions); | ||
} | ||
completeUnsafe(error?: ErrorLike) { | ||
this.isCompleted = true; | ||
if (error !== undefined || this.queue.length + this.activeCount === 0) { | ||
this.subscriptions.dispose(); | ||
this.delegate.complete(error); | ||
@@ -67,12 +71,15 @@ } | ||
observe({ | ||
next: (data: T) => { | ||
onNext: (data: T) => { | ||
this.delegate.next(data); | ||
}, | ||
complete: (error?: ErrorLike) => { | ||
onComplete: (error?: ErrorLike) => { | ||
this.activeCount--; | ||
this.remove(nextObsSubscription); | ||
this.subscriptions.remove(nextObsSubscription); | ||
if (error !== undefined) { | ||
this.isCompleted = true; | ||
this.delegate.complete(error); | ||
if (!this.isCompleted) { | ||
this.complete(error); | ||
} else { | ||
this.completeUnsafe(error); | ||
} | ||
} else { | ||
@@ -86,3 +93,3 @@ this.subscribeNext(); | ||
this.add(nextObsSubscription); | ||
this.subscriptions.add(nextObsSubscription); | ||
} else if (this.isCompleted) { | ||
@@ -89,0 +96,0 @@ this.delegate.complete(); |
@@ -18,3 +18,3 @@ import { | ||
completeUnsafe(error?: ErrorLike) { | ||
this.observer.complete(error); | ||
this.observer.onComplete(error); | ||
this.delegate.complete(error); | ||
@@ -24,14 +24,7 @@ } | ||
nextUnsafe(data: T) { | ||
this.observer.next(data); | ||
this.observer.onNext(data); | ||
// Performance: Only sink notifications if there is | ||
// another delegate in the subscriber chain. | ||
if ( | ||
(this.delegate as AbstractDelegatingSubscriber<T, unknown>).nextUnsafe !== | ||
undefined | ||
) { | ||
(this.delegate as AbstractDelegatingSubscriber<T, unknown>).nextUnsafe( | ||
data, | ||
); | ||
} | ||
this.delegate.nextUnsafe(data); | ||
} | ||
@@ -60,4 +53,4 @@ } | ||
observe({ | ||
next: ignore, | ||
complete: onComplete, | ||
onNext: ignore, | ||
onComplete, | ||
}); | ||
@@ -69,4 +62,4 @@ | ||
observe({ | ||
next: ignore, | ||
complete: (error?: ErrorLike) => { | ||
onNext: ignore, | ||
onComplete: (error?: ErrorLike) => { | ||
if (error !== undefined) { | ||
@@ -83,4 +76,4 @@ const { cause } = error; | ||
observe({ | ||
next: onNext, | ||
complete: ignore, | ||
onNext, | ||
onComplete: ignore, | ||
}); |
@@ -27,4 +27,4 @@ import { | ||
if (!disposable.isDisposed) { | ||
observer.next(v); | ||
observer.complete(); | ||
observer.onNext(v); | ||
observer.onComplete(); | ||
} | ||
@@ -34,3 +34,3 @@ }, | ||
if (!disposable.isDisposed) { | ||
observer.complete({ cause }); | ||
observer.onComplete({ cause }); | ||
} | ||
@@ -64,3 +64,3 @@ }, | ||
next(x: T) { | ||
onNext(x: T) { | ||
if (this.result === undefined) { | ||
@@ -73,3 +73,3 @@ this.result = [x]; | ||
complete(err?: ErrorLike) { | ||
onComplete(err?: ErrorLike) { | ||
this.subscription.dispose(); | ||
@@ -76,0 +76,0 @@ if (err !== undefined) { |
@@ -24,3 +24,3 @@ import { | ||
if (error === undefined) { | ||
this.delegate.next(this.acc); | ||
this.delegate.nextUnsafe(this.acc); | ||
} | ||
@@ -27,0 +27,0 @@ this.delegate.complete(error); |
@@ -26,3 +26,3 @@ import { | ||
complete(error?: ErrorLike) { | ||
onComplete(error?: ErrorLike) { | ||
let shouldComplete = false; | ||
@@ -44,3 +44,3 @@ try { | ||
next(data: T) { | ||
onNext(data: T) { | ||
this.parent.delegate.next(data); | ||
@@ -62,2 +62,3 @@ } | ||
private readonly shouldRepeat: (count: number, error?: ErrorLike) => boolean; | ||
constructor( | ||
@@ -78,7 +79,7 @@ delegate: SubscriberLike<T>, | ||
completeUnsafe(error?: ErrorLike) { | ||
this.observer.complete(error); | ||
this.observer.onComplete(error); | ||
} | ||
nextUnsafe(data: T) { | ||
this.observer.next(data); | ||
this.observer.onNext(data); | ||
} | ||
@@ -85,0 +86,0 @@ } |
@@ -61,9 +61,4 @@ import { disposed } from "@reactive-js/disposable"; | ||
const innerSubscription = pipe( | ||
subject, | ||
observe(subscriber), | ||
subscribe(subscriber), | ||
); | ||
subscriber.add(this.teardown, innerSubscription); | ||
subject.subscribe(subscriber) | ||
subscriber.add(this.teardown); | ||
} | ||
@@ -70,0 +65,0 @@ } |
@@ -25,3 +25,3 @@ import { createSerialDisposable } from "@reactive-js/disposable"; | ||
complete(error?: ErrorLike) { | ||
onComplete(error?: ErrorLike) { | ||
if (error !== undefined) { | ||
@@ -32,3 +32,3 @@ this.parent.complete(error); | ||
next(data: T) { | ||
onNext(data: T) { | ||
this.parent.delegate.next(data); | ||
@@ -35,0 +35,0 @@ } |
@@ -24,5 +24,5 @@ import { | ||
if (this.count < this.maxCount) { | ||
this.delegate.next(data); | ||
this.delegate.nextUnsafe(data); | ||
} else if (this.count === this.maxCount) { | ||
this.delegate.complete(); | ||
this.complete(); | ||
} | ||
@@ -29,0 +29,0 @@ } |
@@ -17,3 +17,3 @@ import { | ||
private readonly drainQueue: SchedulerContinuationLike = shouldYield => { | ||
while (this.last.length > 0) { | ||
while (this.last.length > 0 && !this.delegate.isCompleted) { | ||
const next = this.last.shift() as T; | ||
@@ -20,0 +20,0 @@ this.delegate.next(next); |
@@ -22,3 +22,3 @@ import { | ||
if (this.predicate(data)) { | ||
this.delegate.next(data); | ||
this.delegate.nextUnsafe(data); | ||
} else { | ||
@@ -25,0 +25,0 @@ this.complete(); |
@@ -43,3 +43,3 @@ import { | ||
this.delegate.next(data); | ||
this.delegate.nextUnsafe(data); | ||
} | ||
@@ -46,0 +46,0 @@ } |
@@ -25,3 +25,3 @@ import { DisposableLike } from "@reactive-js/disposable"; | ||
complete(error?: ErrorLike) { | ||
onComplete(error?: ErrorLike) { | ||
if (error !== undefined) { | ||
@@ -32,3 +32,3 @@ this.parent.complete(error); | ||
next(data: TB) { | ||
onNext(data: TB) { | ||
if (this.parent.otherLatest === undefined) { | ||
@@ -72,7 +72,6 @@ this.parent.otherLatest = [data]; | ||
const result = this.selector(data, otherLatest); | ||
// Performance: Bypass safety checks and directly | ||
// sink notifcations to the delegate. | ||
(this.delegate as AbstractDelegatingSubscriber<TC, unknown>).nextUnsafe( | ||
result, | ||
); | ||
// sink notifications to the delegate. | ||
this.delegate.nextUnsafe(result); | ||
} | ||
@@ -86,5 +85,3 @@ } | ||
): SubscriberOperatorLike<TA, TC> => subscriber => | ||
subscriber instanceof AbstractDelegatingSubscriber | ||
? new WithLatestFromSubscriber(subscriber, other, selector) | ||
: (subscriber as SubscriberLike<any>); | ||
new WithLatestFromSubscriber(subscriber, other, selector); | ||
@@ -91,0 +88,0 @@ export const withLatestFrom = <TA, TB, TC>( |
@@ -79,4 +79,4 @@ import { | ||
const createMockObserver = <T>(): ObserverLike<T> => ({ | ||
next: jest.fn(), | ||
complete: jest.fn(), | ||
onNext: jest.fn(), | ||
onComplete: jest.fn(), | ||
}); | ||
@@ -87,4 +87,4 @@ | ||
observe({ | ||
next: onNext, | ||
complete: _ => {}, | ||
onNext: onNext, | ||
onComplete: _ => {}, | ||
}); | ||
@@ -95,3 +95,3 @@ const scheduler = createVirtualTimeSchedulerResource(); | ||
const liftedObservable = pipe( | ||
createObservable(observer => observer.next(1)), | ||
createObservable(observer => observer.onNext(1)), | ||
onNext(_ => result.push(1)), | ||
@@ -288,8 +288,8 @@ ); | ||
expect(observer.next).toHaveBeenNthCalledWith(1, [3, 1]); | ||
expect(observer.next).toHaveBeenNthCalledWith(2, [6, 2]); | ||
expect(observer.next).toHaveBeenNthCalledWith(3, [9, 3]); | ||
expect(observer.next).toHaveBeenNthCalledWith(4, [12, 4]); | ||
expect(observer.next).toHaveBeenNthCalledWith(5, [15, 5]); | ||
expect(observer.next).toHaveBeenNthCalledWith(6, [18, 6]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(1, [3, 1]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(2, [6, 2]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(3, [9, 3]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(4, [12, 4]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(5, [15, 5]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(6, [18, 6]); | ||
}); | ||
@@ -329,8 +329,8 @@ }); | ||
expect(observer.next).toHaveBeenNthCalledWith(1, [3, 1]); | ||
expect(observer.next).toHaveBeenNthCalledWith(2, [6, 2]); | ||
expect(observer.next).toHaveBeenNthCalledWith(3, [9, 3]); | ||
expect(observer.next).toHaveBeenNthCalledWith(4, [12, 4]); | ||
expect(observer.next).toHaveBeenNthCalledWith(5, [15, 5]); | ||
expect(observer.next).toHaveBeenNthCalledWith(6, [18, 6]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(1, [3, 1]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(2, [6, 2]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(3, [9, 3]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(4, [12, 4]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(5, [15, 5]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(6, [18, 6]); | ||
}); | ||
@@ -402,8 +402,8 @@ | ||
expect(observer.next).toHaveBeenNthCalledWith(1, [0, 1]); | ||
expect(observer.next).toHaveBeenNthCalledWith(2, [0, 1]); | ||
expect(observer.next).toHaveBeenNthCalledWith(3, [0, 1]); | ||
expect(observer.next).toHaveBeenNthCalledWith(4, [1, 2]); | ||
expect(observer.next).toHaveBeenNthCalledWith(5, [3, 3]); | ||
expect(observer.next).toHaveBeenNthCalledWith(6, [6, 4]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(1, [0, 1]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(2, [0, 1]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(3, [0, 1]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(4, [1, 2]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(5, [3, 3]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(6, [6, 4]); | ||
}); | ||
@@ -469,8 +469,8 @@ | ||
expect(observer.next).toHaveBeenCalledTimes(5); | ||
expect(observer.next).toHaveBeenNthCalledWith(1, [5, 1]); | ||
expect(observer.next).toHaveBeenNthCalledWith(2, [10, 2]); | ||
expect(observer.next).toHaveBeenNthCalledWith(3, [15, 3]); | ||
expect(observer.next).toHaveBeenNthCalledWith(4, [20, 4]); | ||
expect(observer.next).toHaveBeenNthCalledWith(5, [25, 5]); | ||
expect(observer.onNext).toHaveBeenCalledTimes(5); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(1, [5, 1]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(2, [10, 2]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(3, [15, 3]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(4, [20, 4]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(5, [25, 5]); | ||
}); | ||
@@ -500,7 +500,7 @@ | ||
expect(observer.next).toHaveBeenCalledTimes(3); | ||
expect(observer.next).toHaveBeenNthCalledWith(1, [5, 1]); | ||
expect(observer.next).toHaveBeenNthCalledWith(2, [10, 2]); | ||
expect(observer.next).toHaveBeenNthCalledWith(3, [15, 3]); | ||
expect(observer.complete).toBeCalledWith({ cause }); | ||
expect(observer.onNext).toHaveBeenCalledTimes(3); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(1, [5, 1]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(2, [10, 2]); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(3, [15, 3]); | ||
expect(observer.onComplete).toBeCalledWith({ cause }); | ||
}); | ||
@@ -518,4 +518,4 @@ }); | ||
expect(observer.next).toBeCalledTimes(0); | ||
expect(observer.complete).toBeCalledWith({ cause }); | ||
expect(observer.onNext).toBeCalledTimes(0); | ||
expect(observer.onComplete).toBeCalledWith({ cause }); | ||
}); | ||
@@ -537,5 +537,5 @@ | ||
expect(observer.next).toHaveBeenNthCalledWith(1, 2); | ||
expect(observer.next).toBeCalledTimes(1); | ||
expect(observer.complete).toBeCalledWith({ cause }); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(1, 2); | ||
expect(observer.onNext).toBeCalledTimes(1); | ||
expect(observer.onComplete).toBeCalledWith({ cause }); | ||
}); | ||
@@ -573,8 +573,8 @@ | ||
expect(observer.next).toHaveBeenNthCalledWith(1, 3); | ||
expect(observer.next).toHaveBeenNthCalledWith(2, 2); | ||
expect(observer.next).toHaveBeenNthCalledWith(3, 5); | ||
expect(observer.next).toHaveBeenNthCalledWith(4, 4); | ||
expect(observer.next).toHaveBeenNthCalledWith(5, 7); | ||
expect(observer.complete).toBeCalledWith({ cause }); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(1, 3); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(2, 2); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(3, 5); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(4, 4); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(5, 7); | ||
expect(observer.onComplete).toBeCalledWith({ cause }); | ||
}); | ||
@@ -588,4 +588,4 @@ | ||
expect(observer.next).toHaveBeenCalledTimes(0); | ||
expect(observer.complete).toHaveBeenCalledTimes(0); | ||
expect(observer.onNext).toHaveBeenCalledTimes(0); | ||
expect(observer.onComplete).toHaveBeenCalledTimes(0); | ||
}); | ||
@@ -609,3 +609,3 @@ }); | ||
expect(observer.complete).toHaveBeenCalledWith(undefined); | ||
expect(observer.onComplete).toHaveBeenCalledWith(undefined); | ||
expect(cb).toHaveBeenCalledWith(undefined); | ||
@@ -624,3 +624,3 @@ }); | ||
expect(observer.complete).toHaveBeenCalledWith({ cause }); | ||
expect(observer.onComplete).toHaveBeenCalledWith({ cause }); | ||
expect(cb).toHaveBeenCalledWith(cause); | ||
@@ -637,3 +637,3 @@ }); | ||
expect(observer.complete).toHaveBeenCalledTimes(1); | ||
expect(observer.onComplete).toHaveBeenCalledTimes(1); | ||
expect(cb).toHaveBeenCalledTimes(0); | ||
@@ -651,3 +651,3 @@ }); | ||
expect(observer.next).toHaveBeenCalledWith(1); | ||
expect(observer.onNext).toHaveBeenCalledWith(1); | ||
expect(cb).toHaveBeenCalledWith(1); | ||
@@ -693,6 +693,6 @@ }); | ||
expect(observer.next).toHaveBeenNthCalledWith(1, 1); | ||
expect(observer.next).toHaveBeenNthCalledWith(2, 3); | ||
expect(observer.next).toHaveBeenNthCalledWith(3, 6); | ||
expect(observer.complete).toBeCalledWith({ cause }); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(1, 1); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(2, 3); | ||
expect(observer.onNext).toHaveBeenNthCalledWith(3, 6); | ||
expect(observer.onComplete).toBeCalledWith({ cause }); | ||
}); | ||
@@ -735,3 +735,3 @@ | ||
).toThrow(cause); | ||
expect(observer.next).toHaveBeenCalledTimes(0); | ||
expect(observer.onNext).toHaveBeenCalledTimes(0); | ||
}); | ||
@@ -808,4 +808,4 @@ }); | ||
expect(observer.next).toBeCalledTimes(0); | ||
expect(observer.complete).toBeCalledWith({ cause }); | ||
expect(observer.onNext).toBeCalledTimes(0); | ||
expect(observer.onComplete).toBeCalledWith({ cause }); | ||
}); | ||
@@ -966,8 +966,8 @@ }); | ||
expect(liftedObserver.next).toBeCalledTimes(1); | ||
expect(liftedObserver.next).toBeCalledWith(2); | ||
expect(liftedObserver.complete).toBeCalledTimes(1); | ||
expect(liftedObserver.onNext).toBeCalledTimes(1); | ||
expect(liftedObserver.onNext).toBeCalledWith(2); | ||
expect(liftedObserver.onComplete).toBeCalledTimes(1); | ||
expect(anotherLiftedSubscriptionObserver.next).toBeCalledTimes(3); | ||
expect(anotherLiftedSubscriptionObserver.complete).toBeCalledTimes(1); | ||
expect(anotherLiftedSubscriptionObserver.onNext).toBeCalledTimes(3); | ||
expect(anotherLiftedSubscriptionObserver.onComplete).toBeCalledTimes(1); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
788183
5412
+ Added@reactive-js/disposable@0.0.14(transitive)
+ Added@reactive-js/pipe@0.0.14(transitive)
+ Added@reactive-js/rx@0.0.14(transitive)
+ Added@reactive-js/scheduler@0.0.14(transitive)
+ Added@reactive-js/schedulers@0.0.14(transitive)
- Removed@reactive-js/disposable@0.0.13(transitive)
- Removed@reactive-js/pipe@0.0.13(transitive)
- Removed@reactive-js/rx@0.0.13(transitive)
- Removed@reactive-js/scheduler@0.0.13(transitive)
- Removed@reactive-js/schedulers@0.0.13(transitive)
Updated@reactive-js/pipe@^0.0.14
Updated@reactive-js/rx@^0.0.14