apollo-client-rxjs
Version:
Adds RxJS to ApolloClient
28 lines • 1.27 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { ApolloClient } from 'apollo-client';
import { RxObservableQuery } from './RxObservableQuery';
import { createWithObservableVariables } from './utils/variables';
var RxApolloClient = (function (_super) {
__extends(RxApolloClient, _super);
function RxApolloClient(options) {
return _super.call(this, options) || this;
}
RxApolloClient.prototype.watchQuery = function (options) {
if (typeof options.variables === 'object') {
return createWithObservableVariables(options, _super.prototype.watchQuery.bind(this));
}
return new RxObservableQuery(_super.prototype.watchQuery.call(this, options));
};
return RxApolloClient;
}(ApolloClient));
export { RxApolloClient };
//# sourceMappingURL=RxApolloClient.js.map