UNPKG

apollo-client

Version:
26 lines 837 B
import $$observable from 'symbol-observable'; function isSubscription(subscription) { return subscription.unsubscribe !== undefined; } var Observable = (function () { function Observable(subscriberFunction) { this.subscriberFunction = subscriberFunction; } Observable.prototype[$$observable] = function () { return this; }; Observable.prototype.subscribe = function (observer) { var subscriptionOrCleanupFunction = this.subscriberFunction(observer); if (isSubscription(subscriptionOrCleanupFunction)) { return subscriptionOrCleanupFunction; } else { return { unsubscribe: subscriptionOrCleanupFunction, }; } }; return Observable; }()); export { Observable }; //# sourceMappingURL=Observable.js.map