Bones/node_modules/rxjs/util/toSubscriber.js

16 lines
666 B
JavaScript
Raw Normal View History

2017-05-17 13:45:25 -04:00
"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