mirror of
https://github.com/biobulkbende/biobulkbende.org.git
synced 2024-12-27 05:15:25 +00:00
18 lines
689 B
JavaScript
18 lines
689 B
JavaScript
import { Subscriber } from '../Subscriber';
|
|
import { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';
|
|
import { empty as emptyObserver } from '../Observer';
|
|
export function toSubscriber(nextOrObserver, error, complete) {
|
|
if (nextOrObserver) {
|
|
if (nextOrObserver instanceof Subscriber) {
|
|
return nextOrObserver;
|
|
}
|
|
if (nextOrObserver[rxSubscriberSymbol]) {
|
|
return nextOrObserver[rxSubscriberSymbol]();
|
|
}
|
|
}
|
|
if (!nextOrObserver && !error && !complete) {
|
|
return new Subscriber(emptyObserver);
|
|
}
|
|
return new Subscriber(nextOrObserver, error, complete);
|
|
}
|
|
//# sourceMappingURL=toSubscriber.js.map
|