Bones/node_modules/rxjs/util/toSubscriber.js
SOUTHERNCO\x2mjbyrn 7efe7605b8 Template Upload
2017-05-17 13:45:25 -04:00

16 lines
666 B
JavaScript

"use strict";
var Subscriber_1 = require('../Subscriber');
var rxSubscriber_1 = require('../symbol/rxSubscriber');
function toSubscriber(nextOrObserver, error, complete) {
if (nextOrObserver && typeof nextOrObserver === 'object') {
if (nextOrObserver instanceof Subscriber_1.Subscriber) {
return nextOrObserver;
}
else if (typeof nextOrObserver[rxSubscriber_1.rxSubscriber] === 'function') {
return nextOrObserver[rxSubscriber_1.rxSubscriber]();
}
}
return new Subscriber_1.Subscriber(nextOrObserver, error, complete);
}
exports.toSubscriber = toSubscriber;
//# sourceMappingURL=toSubscriber.js.map