UNPKG

2.03 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('apollo-link'), require('subscriptions-transport-ws')) :
3 typeof define === 'function' && define.amd ? define(['exports', 'apollo-link', 'subscriptions-transport-ws'], factory) :
4 (factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.ws = {}),global.apolloLink.core,global.subscriptionsTransportWs));
5}(this, (function (exports,apolloLink,subscriptionsTransportWs) { 'use strict';
6
7 var __extends = (undefined && undefined.__extends) || (function () {
8 var extendStatics = Object.setPrototypeOf ||
9 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
10 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
11 return function (d, b) {
12 extendStatics(d, b);
13 function __() { this.constructor = d; }
14 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15 };
16 })();
17 var WebSocketLink = /** @class */ (function (_super) {
18 __extends(WebSocketLink, _super);
19 function WebSocketLink(paramsOrClient) {
20 var _this = _super.call(this) || this;
21 if (paramsOrClient instanceof subscriptionsTransportWs.SubscriptionClient) {
22 _this.subscriptionClient = paramsOrClient;
23 }
24 else {
25 _this.subscriptionClient = new subscriptionsTransportWs.SubscriptionClient(paramsOrClient.uri, paramsOrClient.options, paramsOrClient.webSocketImpl);
26 }
27 return _this;
28 }
29 WebSocketLink.prototype.request = function (operation) {
30 return this.subscriptionClient.request(operation);
31 };
32 return WebSocketLink;
33 }(apolloLink.ApolloLink));
34
35 exports.WebSocketLink = WebSocketLink;
36
37 Object.defineProperty(exports, '__esModule', { value: true });
38
39})));
40//# sourceMappingURL=bundle.umd.js.map