UNPKG

2.13 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 = function (d, b) {
9 extendStatics = Object.setPrototypeOf ||
10 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
11 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
12 return extendStatics(d, b);
13 };
14 return function (d, b) {
15 extendStatics(d, b);
16 function __() { this.constructor = d; }
17 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18 };
19 })();
20 var WebSocketLink = /** @class */ (function (_super) {
21 __extends(WebSocketLink, _super);
22 function WebSocketLink(paramsOrClient) {
23 var _this = _super.call(this) || this;
24 if (paramsOrClient instanceof subscriptionsTransportWs.SubscriptionClient) {
25 _this.subscriptionClient = paramsOrClient;
26 }
27 else {
28 _this.subscriptionClient = new subscriptionsTransportWs.SubscriptionClient(paramsOrClient.uri, paramsOrClient.options, paramsOrClient.webSocketImpl);
29 }
30 return _this;
31 }
32 WebSocketLink.prototype.request = function (operation) {
33 return this.subscriptionClient.request(operation);
34 };
35 return WebSocketLink;
36 }(apolloLink.ApolloLink));
37
38 exports.WebSocketLink = WebSocketLink;
39
40 Object.defineProperty(exports, '__esModule', { value: true });
41
42})));
43//# sourceMappingURL=bundle.umd.js.map