UNPKG

apollo-link-ws

Version:
31 lines (26 loc) 1.52 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('apollo-link'), require('subscriptions-transport-ws')) : typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'apollo-link', 'subscriptions-transport-ws'], factory) : (global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.ws = {}), global.tslib, global.apolloLink.core, global['subscriptions-transport-ws'])); }(this, (function (exports, tslib_1, apolloLink, subscriptionsTransportWs) { 'use strict'; var WebSocketLink = (function (_super) { tslib_1.__extends(WebSocketLink, _super); function WebSocketLink(paramsOrClient) { var _this = _super.call(this) || this; if (paramsOrClient instanceof subscriptionsTransportWs.SubscriptionClient) { _this.subscriptionClient = paramsOrClient; } else { _this.subscriptionClient = new subscriptionsTransportWs.SubscriptionClient(paramsOrClient.uri, paramsOrClient.options, paramsOrClient.webSocketImpl); } return _this; } WebSocketLink.prototype.request = function (operation) { return this.subscriptionClient.request(operation); }; return WebSocketLink; }(apolloLink.ApolloLink)); exports.WebSocketLink = WebSocketLink; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=bundle.umd.js.map