@trpc/client 10.0.0-alpha.2 → 10.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{TRPCClientError-e1da1ef0.esm.js → TRPCClientError-17b117e1.mjs} +16 -7
- package/dist/TRPCClientError-ec6bd2ca.js +94 -0
- package/dist/{declarations/src/TRPCClientError.d.ts → TRPCClientError.d.ts} +29 -29
- package/dist/TRPCClientError.d.ts.map +1 -0
- package/dist/{createChain-e45e6cf2.esm.js → createChain-389cc116.mjs} +1 -1
- package/dist/{createChain-93a38e1c.cjs.dev.js → createChain-864dbb30.js} +1 -1
- package/dist/{declarations/src/createTRPCClient.d.ts → createTRPCClient.d.ts} +5 -5
- package/dist/createTRPCClient.d.ts.map +1 -0
- package/dist/{declarations/src/getFetch.d.ts → getFetch.d.ts} +1 -1
- package/dist/getFetch.d.ts.map +1 -0
- package/dist/{httpUtils-a1426e14.cjs.dev.js → httpUtils-1f9e4e3c.js} +9 -1
- package/dist/{httpUtils-e45c9056.esm.js → httpUtils-c09d7b79.mjs} +5 -1
- package/dist/{declarations/src/index.d.ts → index.d.ts} +4 -4
- package/dist/index.d.ts.map +1 -0
- package/dist/{trpc-client.cjs.prod.js → index.js} +30 -16
- package/dist/{trpc-client.esm.js → index.mjs} +19 -15
- package/dist/index.ts.js +1 -0
- package/dist/{declarations/src/internals → internals}/TRPCClient.d.ts +64 -64
- package/dist/internals/TRPCClient.d.ts.map +1 -0
- package/dist/{declarations/src/internals → internals}/dataLoader.d.ts +14 -14
- package/dist/internals/dataLoader.d.ts.map +1 -0
- package/dist/{declarations/src/internals → internals}/fetchHelpers.d.ts +2 -2
- package/dist/internals/fetchHelpers.d.ts.map +1 -0
- package/dist/{declarations/src/internals → internals}/retryDelay.d.ts +1 -1
- package/dist/internals/retryDelay.d.ts.map +1 -0
- package/dist/internals/transformRPCResponse.d.ts +15 -0
- package/dist/internals/transformRPCResponse.d.ts.map +1 -0
- package/dist/links/dedupeLink.d.ts +4 -0
- package/dist/links/dedupeLink.d.ts.map +1 -0
- package/dist/{declarations/src/links → links}/httpBatchLink.d.ts +4 -4
- package/dist/links/httpBatchLink.d.ts.map +1 -0
- package/dist/links/httpBatchLink.js +189 -0
- package/dist/links/httpBatchLink.mjs +185 -0
- package/dist/links/httpBatchLink.ts.js +1 -0
- package/dist/{declarations/src/links → links}/httpLink.d.ts +4 -4
- package/dist/links/httpLink.d.ts.map +1 -0
- package/dist/links/httpLink.js +44 -0
- package/dist/links/httpLink.mjs +40 -0
- package/dist/links/httpLink.ts.js +1 -0
- package/dist/{declarations/src/links → links}/httpUtils.d.ts +21 -21
- package/dist/links/httpUtils.d.ts.map +1 -0
- package/dist/{declarations/src/links → links}/internals/createChain.d.ts +7 -7
- package/dist/links/internals/createChain.d.ts.map +1 -0
- package/dist/{declarations/src/links → links}/internals/transformOperationResult.d.ts +15 -15
- package/dist/links/internals/transformOperationResult.d.ts.map +1 -0
- package/dist/{declarations/src/links → links}/loggerLink.d.ts +38 -38
- package/dist/links/loggerLink.d.ts.map +1 -0
- package/dist/links/loggerLink.js +108 -0
- package/dist/links/loggerLink.mjs +99 -0
- package/dist/links/loggerLink.ts.js +1 -0
- package/dist/links/retryLink.d.ts +6 -0
- package/dist/links/retryLink.d.ts.map +1 -0
- package/dist/{declarations/src/links → links}/splitLink.d.ts +13 -13
- package/dist/links/splitLink.d.ts.map +1 -0
- package/dist/links/splitLink.js +32 -0
- package/dist/links/splitLink.mjs +28 -0
- package/dist/links/splitLink.ts.js +1 -0
- package/dist/{declarations/src/links → links}/transformerLink.d.ts +3 -3
- package/dist/links/transformerLink.d.ts.map +1 -0
- package/dist/links/transformerLink.js +75 -0
- package/dist/links/transformerLink.mjs +67 -0
- package/dist/links/transformerLink.ts.js +1 -0
- package/dist/{declarations/src/links → links}/types.d.ts +39 -39
- package/dist/links/types.d.ts.map +1 -0
- package/dist/{declarations/src/links → links}/wsLink.d.ts +19 -19
- package/dist/links/wsLink.d.ts.map +1 -0
- package/dist/links/wsLink.js +384 -0
- package/dist/links/wsLink.mjs +370 -0
- package/dist/links/wsLink.ts.js +1 -0
- package/dist/{observable-01534ea8.esm.js → observable-7e66cb56.mjs} +0 -0
- package/dist/{observable-9aad8c3e.cjs.dev.js → observable-85669100.js} +0 -0
- package/dist/{declarations/src/rx → rx}/index.d.ts +2 -2
- package/dist/rx/index.d.ts.map +1 -0
- package/dist/rx/index.js +9 -0
- package/dist/rx/index.mjs +1 -0
- package/dist/rx/index.ts.js +1 -0
- package/dist/{declarations/src/rx → rx}/observable.d.ts +3 -3
- package/dist/rx/observable.d.ts.map +1 -0
- package/dist/{declarations/src/rx → rx}/operators/index.d.ts +3 -3
- package/dist/rx/operators/index.d.ts.map +1 -0
- package/dist/rx/operators/index.js +38 -0
- package/dist/rx/operators/index.mjs +32 -0
- package/dist/rx/operators/index.ts.js +1 -0
- package/dist/{declarations/src/rx → rx}/operators/map.d.ts +2 -2
- package/dist/rx/operators/map.d.ts.map +1 -0
- package/dist/{declarations/src/rx → rx}/operators/share.d.ts +5 -5
- package/dist/rx/operators/share.d.ts.map +1 -0
- package/dist/{declarations/src/rx → rx}/operators/tap.d.ts +2 -2
- package/dist/rx/operators/tap.d.ts.map +1 -0
- package/dist/{declarations/src/rx → rx}/types.d.ts +28 -28
- package/dist/rx/types.d.ts.map +1 -0
- package/dist/{declarations/src/rx → rx}/util/identity.d.ts +1 -1
- package/dist/rx/util/identity.d.ts.map +1 -0
- package/dist/{declarations/src/rx → rx}/util/observableToPromise.d.ts +9 -9
- package/dist/rx/util/observableToPromise.d.ts.map +1 -0
- package/dist/{declarations/src/rx → rx}/util/pipe.d.ts +3 -3
- package/dist/rx/util/pipe.d.ts.map +1 -0
- package/dist/{share-f2ac9332.cjs.dev.js → share-4d79dc49.js} +5 -1
- package/dist/{share-ca585761.esm.js → share-671b63fa.mjs} +5 -1
- package/dist/{tap-606957cb.esm.js → tap-538fa07f.mjs} +0 -0
- package/dist/{tap-2d565250.cjs.dev.js → tap-799a2d33.js} +0 -0
- package/links/httpBatchLink/dist/trpc-client-links-httpBatchLink.cjs.dev.js +68 -38
- package/links/httpBatchLink/dist/trpc-client-links-httpBatchLink.cjs.prod.js +68 -38
- package/links/httpBatchLink/dist/trpc-client-links-httpBatchLink.esm.js +67 -37
- package/links/httpBatchLink/index.d.ts +1 -0
- package/links/httpBatchLink/index.js +1 -0
- package/links/httpLink/dist/trpc-client-links-httpLink.cjs.dev.js +52 -29
- package/links/httpLink/dist/trpc-client-links-httpLink.cjs.prod.js +52 -29
- package/links/httpLink/dist/trpc-client-links-httpLink.esm.js +52 -29
- package/links/httpLink/index.d.ts +1 -0
- package/links/httpLink/index.js +1 -0
- package/links/loggerLink/dist/trpc-client-links-loggerLink.cjs.dev.js +19 -31
- package/links/loggerLink/dist/trpc-client-links-loggerLink.cjs.prod.js +19 -31
- package/links/loggerLink/dist/trpc-client-links-loggerLink.esm.js +19 -31
- package/links/loggerLink/index.d.ts +1 -0
- package/links/loggerLink/index.js +1 -0
- package/links/splitLink/dist/trpc-client-links-splitLink.cjs.dev.js +7 -20
- package/links/splitLink/dist/trpc-client-links-splitLink.cjs.prod.js +7 -20
- package/links/splitLink/dist/trpc-client-links-splitLink.esm.js +7 -20
- package/links/splitLink/index.d.ts +1 -0
- package/links/splitLink/index.js +1 -0
- package/links/transformerLink/index.d.ts +1 -0
- package/links/transformerLink/index.js +1 -0
- package/links/wsLink/dist/trpc-client-links-wsLink.cjs.dev.js +84 -60
- package/links/wsLink/dist/trpc-client-links-wsLink.cjs.prod.js +84 -60
- package/links/wsLink/dist/trpc-client-links-wsLink.esm.js +84 -60
- package/links/wsLink/index.d.ts +1 -0
- package/links/wsLink/index.js +1 -0
- package/package.json +56 -20
- package/rx/index.d.ts +1 -0
- package/rx/index.js +1 -0
- package/rx/operators/index.d.ts +1 -0
- package/rx/operators/index.js +1 -0
- package/dist/TRPCClientError-a5312a5f.cjs.dev.js +0 -74
- package/dist/TRPCClientError-ea7d89b2.cjs.prod.js +0 -74
- package/dist/createChain-e45e052a.cjs.prod.js +0 -27
- package/dist/declarations/src/TRPCClientError.d.ts.map +0 -1
- package/dist/declarations/src/createTRPCClient.d.ts.map +0 -1
- package/dist/declarations/src/getFetch.d.ts.map +0 -1
- package/dist/declarations/src/index.d.ts.map +0 -1
- package/dist/declarations/src/internals/TRPCClient.d.ts.map +0 -1
- package/dist/declarations/src/internals/dataLoader.d.ts.map +0 -1
- package/dist/declarations/src/internals/fetchHelpers.d.ts.map +0 -1
- package/dist/declarations/src/internals/retryDelay.d.ts.map +0 -1
- package/dist/declarations/src/links/httpBatchLink.d.ts.map +0 -1
- package/dist/declarations/src/links/httpLink.d.ts.map +0 -1
- package/dist/declarations/src/links/httpUtils.d.ts.map +0 -1
- package/dist/declarations/src/links/internals/createChain.d.ts.map +0 -1
- package/dist/declarations/src/links/internals/transformOperationResult.d.ts.map +0 -1
- package/dist/declarations/src/links/loggerLink.d.ts.map +0 -1
- package/dist/declarations/src/links/splitLink.d.ts.map +0 -1
- package/dist/declarations/src/links/transformerLink.d.ts.map +0 -1
- package/dist/declarations/src/links/types.d.ts.map +0 -1
- package/dist/declarations/src/links/wsLink.d.ts.map +0 -1
- package/dist/declarations/src/rx/index.d.ts.map +0 -1
- package/dist/declarations/src/rx/observable.d.ts.map +0 -1
- package/dist/declarations/src/rx/operators/index.d.ts.map +0 -1
- package/dist/declarations/src/rx/operators/map.d.ts.map +0 -1
- package/dist/declarations/src/rx/operators/share.d.ts.map +0 -1
- package/dist/declarations/src/rx/operators/tap.d.ts.map +0 -1
- package/dist/declarations/src/rx/types.d.ts.map +0 -1
- package/dist/declarations/src/rx/util/identity.d.ts.map +0 -1
- package/dist/declarations/src/rx/util/observableToPromise.d.ts.map +0 -1
- package/dist/declarations/src/rx/util/pipe.d.ts.map +0 -1
- package/dist/httpUtils-299a66f6.cjs.prod.js +0 -89
- package/dist/observable-ccb54234.cjs.prod.js +0 -104
- package/dist/share-5a8c2543.cjs.prod.js +0 -106
- package/dist/tap-d907998d.cjs.prod.js +0 -32
- package/dist/trpc-client.cjs.d.ts +0 -1
- package/dist/trpc-client.cjs.dev.js +0 -300
- package/dist/trpc-client.cjs.js +0 -7
- package/links/httpBatchLink/package.json +0 -4
- package/links/httpLink/package.json +0 -4
- package/links/loggerLink/package.json +0 -4
- package/links/splitLink/package.json +0 -4
- package/links/transformerLink/package.json +0 -4
- package/links/wsLink/package.json +0 -4
- package/rx/operators/package.json +0 -4
- package/rx/package.json +0 -4
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
|
+
import _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized';
|
|
3
|
+
import _inherits from '@babel/runtime/helpers/inherits';
|
|
4
|
+
import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
|
|
5
|
+
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
6
|
+
import _wrapNativeSuper from '@babel/runtime/helpers/wrapNativeSuper';
|
|
7
|
+
import { o as observable } from '../observable-7e66cb56.mjs';
|
|
8
|
+
import { T as TRPCClientError } from '../TRPCClientError-17b117e1.mjs';
|
|
9
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
10
|
+
import '@babel/runtime/helpers/createClass';
|
|
11
|
+
|
|
12
|
+
/* istanbul ignore next */
|
|
13
|
+
var retryDelay = function retryDelay(attemptIndex) {
|
|
14
|
+
return attemptIndex === 0 ? 0 : Math.min(1000 * Math.pow(2, attemptIndex), 30000);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
+
|
|
19
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
+
function createWSClient(opts) {
|
|
21
|
+
var url = opts.url,
|
|
22
|
+
_opts$WebSocket = opts.WebSocket,
|
|
23
|
+
WebSocketImpl = _opts$WebSocket === void 0 ? WebSocket : _opts$WebSocket,
|
|
24
|
+
_opts$retryDelayMs = opts.retryDelayMs,
|
|
25
|
+
retryDelayFn = _opts$retryDelayMs === void 0 ? retryDelay : _opts$retryDelayMs;
|
|
26
|
+
/* istanbul ignore next */
|
|
27
|
+
|
|
28
|
+
if (!WebSocketImpl) {
|
|
29
|
+
throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* outgoing messages buffer whilst not open
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var outgoing = [];
|
|
37
|
+
/**
|
|
38
|
+
* pending outgoing requests that are awaiting callback
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
var pendingRequests = Object.create(null);
|
|
42
|
+
var connectAttempt = 0;
|
|
43
|
+
var dispatchTimer = null;
|
|
44
|
+
var connectTimer = null;
|
|
45
|
+
var activeConnection = createWS();
|
|
46
|
+
var state = 'connecting';
|
|
47
|
+
/**
|
|
48
|
+
* tries to send the list of messages
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
function dispatch() {
|
|
52
|
+
if (state !== 'open' || dispatchTimer) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
dispatchTimer = setTimeout(function () {
|
|
57
|
+
dispatchTimer = null;
|
|
58
|
+
|
|
59
|
+
if (outgoing.length === 1) {
|
|
60
|
+
// single send
|
|
61
|
+
activeConnection.send(JSON.stringify(outgoing.pop()));
|
|
62
|
+
} else {
|
|
63
|
+
// batch send
|
|
64
|
+
activeConnection.send(JSON.stringify(outgoing));
|
|
65
|
+
} // clear
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
outgoing = [];
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function tryReconnect() {
|
|
73
|
+
if (connectTimer || state === 'closed') {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var timeout = retryDelayFn(connectAttempt++);
|
|
78
|
+
reconnectInMs(timeout);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function reconnect() {
|
|
82
|
+
state = 'connecting';
|
|
83
|
+
var oldConnection = activeConnection;
|
|
84
|
+
activeConnection = createWS();
|
|
85
|
+
closeIfNoPending(oldConnection);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function reconnectInMs(ms) {
|
|
89
|
+
if (connectTimer) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
state = 'connecting';
|
|
94
|
+
connectTimer = setTimeout(reconnect, ms);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function closeIfNoPending(conn) {
|
|
98
|
+
// disconnect as soon as there are are no pending result
|
|
99
|
+
var hasPendingRequests = Object.values(pendingRequests).some(function (p) {
|
|
100
|
+
return p.ws === conn;
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
if (!hasPendingRequests) {
|
|
104
|
+
conn.close();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function resumeSubscriptionOnReconnect(req) {
|
|
109
|
+
if (outgoing.some(function (r) {
|
|
110
|
+
return r.id === req.op.id;
|
|
111
|
+
})) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
request(req.op, req.callbacks);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function createWS() {
|
|
119
|
+
var conn = new WebSocket(url);
|
|
120
|
+
clearTimeout(connectTimer);
|
|
121
|
+
connectTimer = null;
|
|
122
|
+
conn.addEventListener('open', function () {
|
|
123
|
+
/* istanbul ignore next */
|
|
124
|
+
if (conn !== activeConnection) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
connectAttempt = 0;
|
|
129
|
+
state = 'open';
|
|
130
|
+
dispatch();
|
|
131
|
+
});
|
|
132
|
+
conn.addEventListener('error', function () {
|
|
133
|
+
if (conn === activeConnection) {
|
|
134
|
+
tryReconnect();
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
var handleIncomingRequest = function handleIncomingRequest(req) {
|
|
139
|
+
if (req.method === 'reconnect' && conn === activeConnection) {
|
|
140
|
+
reconnect(); // notify subscribers
|
|
141
|
+
|
|
142
|
+
for (var _i = 0, _Object$values = Object.values(pendingRequests); _i < _Object$values.length; _i++) {
|
|
143
|
+
var pendingReq = _Object$values[_i];
|
|
144
|
+
|
|
145
|
+
if (pendingReq.type === 'subscription') {
|
|
146
|
+
resumeSubscriptionOnReconnect(pendingReq);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
var handleIncomingResponse = function handleIncomingResponse(data) {
|
|
153
|
+
var _req$callbacks$next, _req$callbacks;
|
|
154
|
+
|
|
155
|
+
var req = data.id !== null && pendingRequests[data.id];
|
|
156
|
+
|
|
157
|
+
if (!req) {
|
|
158
|
+
// do something?
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
(_req$callbacks$next = (_req$callbacks = req.callbacks).next) === null || _req$callbacks$next === void 0 ? void 0 : _req$callbacks$next.call(_req$callbacks, {
|
|
163
|
+
data: data
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
if (req.ws !== activeConnection && conn === activeConnection) {
|
|
167
|
+
var oldWs = req.ws; // gracefully replace old connection with this
|
|
168
|
+
|
|
169
|
+
req.ws = activeConnection;
|
|
170
|
+
closeIfNoPending(oldWs);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if ('result' in data && data.result.type === 'stopped' && conn === activeConnection) {
|
|
174
|
+
req.callbacks.complete();
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
conn.addEventListener('message', function (_ref) {
|
|
179
|
+
var data = _ref.data;
|
|
180
|
+
var msg = JSON.parse(data);
|
|
181
|
+
|
|
182
|
+
if ('method' in msg) {
|
|
183
|
+
handleIncomingRequest(msg);
|
|
184
|
+
} else {
|
|
185
|
+
handleIncomingResponse(msg);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (conn !== activeConnection || state === 'closed') {
|
|
189
|
+
// when receiving a message, we close old connection that has no pending requests
|
|
190
|
+
closeIfNoPending(conn);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
conn.addEventListener('close', function () {
|
|
194
|
+
if (activeConnection === conn) {
|
|
195
|
+
// connection might have been replaced already
|
|
196
|
+
tryReconnect();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
for (var key in pendingRequests) {
|
|
200
|
+
var _req$callbacks$error, _req$callbacks2;
|
|
201
|
+
|
|
202
|
+
var req = pendingRequests[key];
|
|
203
|
+
|
|
204
|
+
if (req.ws !== conn) {
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
(_req$callbacks$error = (_req$callbacks2 = req.callbacks).error) === null || _req$callbacks$error === void 0 ? void 0 : _req$callbacks$error.call(_req$callbacks2, TRPCClientError.from(new TRPCWebSocketClosedError('WebSocket closed prematurely')));
|
|
209
|
+
|
|
210
|
+
if (req.type !== 'subscription') {
|
|
211
|
+
var _req$callbacks$comple, _req$callbacks3;
|
|
212
|
+
|
|
213
|
+
delete pendingRequests[key];
|
|
214
|
+
(_req$callbacks$comple = (_req$callbacks3 = req.callbacks).complete) === null || _req$callbacks$comple === void 0 ? void 0 : _req$callbacks$comple.call(_req$callbacks3);
|
|
215
|
+
} else if (state !== 'closed') {
|
|
216
|
+
// request restart of sub with next connection
|
|
217
|
+
resumeSubscriptionOnReconnect(req);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
return conn;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function request(op, callbacks) {
|
|
225
|
+
var type = op.type,
|
|
226
|
+
input = op.input,
|
|
227
|
+
path = op.path,
|
|
228
|
+
id = op.id;
|
|
229
|
+
var envelope = {
|
|
230
|
+
id: id,
|
|
231
|
+
jsonrpc: '2.0',
|
|
232
|
+
method: type,
|
|
233
|
+
params: {
|
|
234
|
+
input: input,
|
|
235
|
+
path: path
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
pendingRequests[id] = {
|
|
239
|
+
ws: activeConnection,
|
|
240
|
+
type: type,
|
|
241
|
+
callbacks: callbacks,
|
|
242
|
+
op: op
|
|
243
|
+
}; // enqueue message
|
|
244
|
+
|
|
245
|
+
outgoing.push(envelope);
|
|
246
|
+
dispatch();
|
|
247
|
+
return function () {
|
|
248
|
+
var _pendingRequests$id, _callbacks$complete;
|
|
249
|
+
|
|
250
|
+
var callbacks = (_pendingRequests$id = pendingRequests[id]) === null || _pendingRequests$id === void 0 ? void 0 : _pendingRequests$id.callbacks;
|
|
251
|
+
delete pendingRequests[id];
|
|
252
|
+
outgoing = outgoing.filter(function (msg) {
|
|
253
|
+
return msg.id !== id;
|
|
254
|
+
});
|
|
255
|
+
callbacks === null || callbacks === void 0 ? void 0 : (_callbacks$complete = callbacks.complete) === null || _callbacks$complete === void 0 ? void 0 : _callbacks$complete.call(callbacks);
|
|
256
|
+
|
|
257
|
+
if (op.type === 'subscription') {
|
|
258
|
+
outgoing.push({
|
|
259
|
+
id: id,
|
|
260
|
+
method: 'subscription.stop',
|
|
261
|
+
params: undefined
|
|
262
|
+
});
|
|
263
|
+
dispatch();
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return {
|
|
269
|
+
close: function close() {
|
|
270
|
+
state = 'closed';
|
|
271
|
+
closeIfNoPending(activeConnection);
|
|
272
|
+
},
|
|
273
|
+
request: request,
|
|
274
|
+
getConnection: function getConnection() {
|
|
275
|
+
return activeConnection;
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
var TRPCWebSocketClosedError = /*#__PURE__*/function (_Error) {
|
|
281
|
+
_inherits(TRPCWebSocketClosedError, _Error);
|
|
282
|
+
|
|
283
|
+
var _super = /*#__PURE__*/_createSuper(TRPCWebSocketClosedError);
|
|
284
|
+
|
|
285
|
+
function TRPCWebSocketClosedError(message) {
|
|
286
|
+
var _this;
|
|
287
|
+
|
|
288
|
+
_classCallCheck(this, TRPCWebSocketClosedError);
|
|
289
|
+
|
|
290
|
+
_this = _super.call(this, message);
|
|
291
|
+
_this.name = 'TRPCWebSocketClosedError';
|
|
292
|
+
Object.setPrototypeOf(_assertThisInitialized(_this), TRPCWebSocketClosedError.prototype);
|
|
293
|
+
return _this;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
return TRPCWebSocketClosedError;
|
|
297
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
298
|
+
|
|
299
|
+
var TRPCSubscriptionEndedError = /*#__PURE__*/function (_Error2) {
|
|
300
|
+
_inherits(TRPCSubscriptionEndedError, _Error2);
|
|
301
|
+
|
|
302
|
+
var _super2 = /*#__PURE__*/_createSuper(TRPCSubscriptionEndedError);
|
|
303
|
+
|
|
304
|
+
function TRPCSubscriptionEndedError(message) {
|
|
305
|
+
var _this2;
|
|
306
|
+
|
|
307
|
+
_classCallCheck(this, TRPCSubscriptionEndedError);
|
|
308
|
+
|
|
309
|
+
_this2 = _super2.call(this, message);
|
|
310
|
+
_this2.name = 'TRPCSubscriptionEndedError';
|
|
311
|
+
Object.setPrototypeOf(_assertThisInitialized(_this2), TRPCSubscriptionEndedError.prototype);
|
|
312
|
+
return _this2;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
return TRPCSubscriptionEndedError;
|
|
316
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
317
|
+
|
|
318
|
+
function wsLink(opts) {
|
|
319
|
+
return function () {
|
|
320
|
+
var client = opts.client;
|
|
321
|
+
return function (_ref2) {
|
|
322
|
+
var op = _ref2.op;
|
|
323
|
+
return observable(function (observer) {
|
|
324
|
+
var type = op.type,
|
|
325
|
+
input = op.input,
|
|
326
|
+
path = op.path,
|
|
327
|
+
id = op.id,
|
|
328
|
+
context = op.context;
|
|
329
|
+
var isDone = false;
|
|
330
|
+
var unsub = client.request({
|
|
331
|
+
type: type,
|
|
332
|
+
path: path,
|
|
333
|
+
input: input,
|
|
334
|
+
id: id,
|
|
335
|
+
context: context
|
|
336
|
+
}, {
|
|
337
|
+
error: function error(err) {
|
|
338
|
+
isDone = true;
|
|
339
|
+
observer.error(err);
|
|
340
|
+
unsub();
|
|
341
|
+
},
|
|
342
|
+
complete: function complete() {
|
|
343
|
+
if (!isDone) {
|
|
344
|
+
isDone = true;
|
|
345
|
+
observer.error(TRPCClientError.from(new TRPCSubscriptionEndedError('Operation ended prematurely')));
|
|
346
|
+
} else {
|
|
347
|
+
observer.complete();
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
next: function next(result) {
|
|
351
|
+
observer.next(result);
|
|
352
|
+
|
|
353
|
+
if (op.type !== 'subscription') {
|
|
354
|
+
// if it isn't a subscription we don't care about next response
|
|
355
|
+
isDone = true;
|
|
356
|
+
unsub();
|
|
357
|
+
observer.complete();
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
return function () {
|
|
362
|
+
isDone = true;
|
|
363
|
+
unsub();
|
|
364
|
+
};
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export { createWSClient, wsLink };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './observable';
|
|
2
|
-
export * from './types';
|
|
1
|
+
export * from './observable';
|
|
2
|
+
export * from './types';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rx/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
package/dist/rx/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { o as observable } from '../observable-7e66cb56.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Observable, Observer, TeardownLogic } from './types';
|
|
2
|
-
export declare type inferObservableValue<TObservable extends Observable<any, any>> = TObservable extends Observable<infer TValue, any> ? TValue : never;
|
|
3
|
-
export declare function observable<TValue, TError = unknown>(subscribe: (observer: Observer<TValue, TError>) => TeardownLogic): Observable<TValue, TError>;
|
|
1
|
+
import { Observable, Observer, TeardownLogic } from './types';
|
|
2
|
+
export declare type inferObservableValue<TObservable extends Observable<any, any>> = TObservable extends Observable<infer TValue, any> ? TValue : never;
|
|
3
|
+
export declare function observable<TValue, TError = unknown>(subscribe: (observer: Observer<TValue, TError>) => TeardownLogic): Observable<TValue, TError>;
|
|
4
4
|
//# sourceMappingURL=observable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observable.d.ts","sourceRoot":"","sources":["../../src/rx/observable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAoB,aAAa,EAAE,MAAM,SAAS,CAAC;AAEhF,oBAAY,oBAAoB,CAAC,WAAW,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,IACvE,WAAW,SAAS,UAAU,CAAC,MAAM,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;AAErE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,EACjD,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,aAAa,GAC/D,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CA6D5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './share';
|
|
2
|
-
export * from './map';
|
|
3
|
-
export * from './tap';
|
|
1
|
+
export * from './share';
|
|
2
|
+
export * from './map';
|
|
3
|
+
export * from './tap';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rx/operators/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var share = require('../../share-4d79dc49.js');
|
|
6
|
+
var tap = require('../../tap-799a2d33.js');
|
|
7
|
+
|
|
8
|
+
function map(project) {
|
|
9
|
+
return function (originalObserver) {
|
|
10
|
+
return {
|
|
11
|
+
subscribe: function subscribe(observer) {
|
|
12
|
+
var index = 0;
|
|
13
|
+
var subscription = originalObserver.subscribe({
|
|
14
|
+
next: function next(value) {
|
|
15
|
+
var _observer$next;
|
|
16
|
+
|
|
17
|
+
(_observer$next = observer.next) === null || _observer$next === void 0 ? void 0 : _observer$next.call(observer, project(value, index++));
|
|
18
|
+
},
|
|
19
|
+
error: function error(_error) {
|
|
20
|
+
var _observer$error;
|
|
21
|
+
|
|
22
|
+
(_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, _error);
|
|
23
|
+
},
|
|
24
|
+
complete: function complete() {
|
|
25
|
+
var _observer$complete;
|
|
26
|
+
|
|
27
|
+
(_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return subscription;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.share = share.share;
|
|
37
|
+
exports.tap = tap.tap;
|
|
38
|
+
exports.map = map;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { s as share } from '../../share-671b63fa.mjs';
|
|
2
|
+
export { t as tap } from '../../tap-538fa07f.mjs';
|
|
3
|
+
|
|
4
|
+
function map(project) {
|
|
5
|
+
return function (originalObserver) {
|
|
6
|
+
return {
|
|
7
|
+
subscribe: function subscribe(observer) {
|
|
8
|
+
var index = 0;
|
|
9
|
+
var subscription = originalObserver.subscribe({
|
|
10
|
+
next: function next(value) {
|
|
11
|
+
var _observer$next;
|
|
12
|
+
|
|
13
|
+
(_observer$next = observer.next) === null || _observer$next === void 0 ? void 0 : _observer$next.call(observer, project(value, index++));
|
|
14
|
+
},
|
|
15
|
+
error: function error(_error) {
|
|
16
|
+
var _observer$error;
|
|
17
|
+
|
|
18
|
+
(_observer$error = observer.error) === null || _observer$error === void 0 ? void 0 : _observer$error.call(observer, _error);
|
|
19
|
+
},
|
|
20
|
+
complete: function complete() {
|
|
21
|
+
var _observer$complete;
|
|
22
|
+
|
|
23
|
+
(_observer$complete = observer.complete) === null || _observer$complete === void 0 ? void 0 : _observer$complete.call(observer);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return subscription;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { map };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { OperatorFunction } from '../types';
|
|
2
|
-
export declare function map<TValueBefore, TError, TValueAfter>(project: (value: TValueBefore, index: number) => TValueAfter): OperatorFunction<TValueBefore, TError, TValueAfter, TError>;
|
|
1
|
+
import { OperatorFunction } from '../types';
|
|
2
|
+
export declare function map<TValueBefore, TError, TValueAfter>(project: (value: TValueBefore, index: number) => TValueAfter): OperatorFunction<TValueBefore, TError, TValueAfter, TError>;
|
|
3
3
|
//# sourceMappingURL=map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../../src/rx/operators/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,wBAAgB,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EACnD,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,WAAW,GAC3D,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAoB7D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MonoTypeOperatorFunction } from '../types';
|
|
2
|
-
interface ShareConfig {
|
|
3
|
-
}
|
|
4
|
-
export declare function share<TValue, TError>(_opts?: ShareConfig): MonoTypeOperatorFunction<TValue, TError>;
|
|
5
|
-
export {};
|
|
1
|
+
import { MonoTypeOperatorFunction } from '../types';
|
|
2
|
+
interface ShareConfig {
|
|
3
|
+
}
|
|
4
|
+
export declare function share<TValue, TError>(_opts?: ShareConfig): MonoTypeOperatorFunction<TValue, TError>;
|
|
5
|
+
export {};
|
|
6
6
|
//# sourceMappingURL=share.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../../src/rx/operators/share.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAA4B,MAAM,UAAU,CAAC;AAG9E,UAAU,WAAW;CAAG;AACxB,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAElC,KAAK,CAAC,EAAE,WAAW,GAClB,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CA2D1C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { MonoTypeOperatorFunction, Observer } from '../types';
|
|
2
|
-
export declare function tap<TValue, TError>(observer: Partial<Observer<TValue, TError>>): MonoTypeOperatorFunction<TValue, TError>;
|
|
1
|
+
import { MonoTypeOperatorFunction, Observer } from '../types';
|
|
2
|
+
export declare function tap<TValue, TError>(observer: Partial<Observer<TValue, TError>>): MonoTypeOperatorFunction<TValue, TError>;
|
|
3
3
|
//# sourceMappingURL=tap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tap.d.ts","sourceRoot":"","sources":["../../../src/rx/operators/tap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9D,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC1C,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAqB1C"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export interface Unsubscribable {
|
|
2
|
-
unsubscribe(): void;
|
|
3
|
-
}
|
|
4
|
-
export declare type UnsubscribeFn = () => void;
|
|
5
|
-
export interface Subscribable<TValue, TError> {
|
|
6
|
-
subscribe(observer: Partial<Observer<TValue, TError>>): Unsubscribable;
|
|
7
|
-
}
|
|
8
|
-
export interface Observable<TValue, TError> extends Subscribable<TValue, TError> {
|
|
9
|
-
pipe(): Observable<TValue, TError>;
|
|
10
|
-
pipe<V1, E1>(op1: OperatorFunction<TValue, TError, V1, E1>): Observable<V1, E1>;
|
|
11
|
-
pipe<V1, E1, V2, E2>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>): Observable<V2, E2>;
|
|
12
|
-
pipe<V1, E1, V2, E2, V3, E3>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>, op3: OperatorFunction<V2, E2, V3, E3>): Observable<V2, E2>;
|
|
13
|
-
pipe<V1, E1, V2, E2, V3, E3, V4, E4>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>, op3: OperatorFunction<V2, E2, V3, E3>, op4: OperatorFunction<V3, E3, V4, E4>): Observable<V2, E2>;
|
|
14
|
-
pipe<V1, E1, V2, E2, V3, E3, V4, E4, V5, E5>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>, op3: OperatorFunction<V2, E2, V3, E3>, op4: OperatorFunction<V3, E3, V4, E4>, op5: OperatorFunction<V4, E4, V5, E5>): Observable<V2, E2>;
|
|
15
|
-
}
|
|
16
|
-
export interface SubscriptionLike extends Unsubscribable {
|
|
17
|
-
unsubscribe(): void;
|
|
18
|
-
readonly closed: boolean;
|
|
19
|
-
}
|
|
20
|
-
export interface Observer<TValue, TError> {
|
|
21
|
-
next: (value: TValue) => void;
|
|
22
|
-
error: (err: TError) => void;
|
|
23
|
-
complete: () => void;
|
|
24
|
-
}
|
|
25
|
-
export declare type TeardownLogic = Unsubscribable | UnsubscribeFn | void;
|
|
26
|
-
export declare type UnaryFunction<T, R> = (source: T) => R;
|
|
27
|
-
export declare type OperatorFunction<TValueBefore, TErrorBefore, TValueAfter, TErrorAfter> = UnaryFunction<Subscribable<TValueBefore, TErrorBefore>, Subscribable<TValueAfter, TErrorAfter>>;
|
|
28
|
-
export declare type MonoTypeOperatorFunction<TValue, TError> = OperatorFunction<TValue, TError, TValue, TError>;
|
|
1
|
+
export interface Unsubscribable {
|
|
2
|
+
unsubscribe(): void;
|
|
3
|
+
}
|
|
4
|
+
export declare type UnsubscribeFn = () => void;
|
|
5
|
+
export interface Subscribable<TValue, TError> {
|
|
6
|
+
subscribe(observer: Partial<Observer<TValue, TError>>): Unsubscribable;
|
|
7
|
+
}
|
|
8
|
+
export interface Observable<TValue, TError> extends Subscribable<TValue, TError> {
|
|
9
|
+
pipe(): Observable<TValue, TError>;
|
|
10
|
+
pipe<V1, E1>(op1: OperatorFunction<TValue, TError, V1, E1>): Observable<V1, E1>;
|
|
11
|
+
pipe<V1, E1, V2, E2>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>): Observable<V2, E2>;
|
|
12
|
+
pipe<V1, E1, V2, E2, V3, E3>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>, op3: OperatorFunction<V2, E2, V3, E3>): Observable<V2, E2>;
|
|
13
|
+
pipe<V1, E1, V2, E2, V3, E3, V4, E4>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>, op3: OperatorFunction<V2, E2, V3, E3>, op4: OperatorFunction<V3, E3, V4, E4>): Observable<V2, E2>;
|
|
14
|
+
pipe<V1, E1, V2, E2, V3, E3, V4, E4, V5, E5>(op1: OperatorFunction<TValue, TError, V1, E1>, op2: OperatorFunction<V1, E1, V2, E2>, op3: OperatorFunction<V2, E2, V3, E3>, op4: OperatorFunction<V3, E3, V4, E4>, op5: OperatorFunction<V4, E4, V5, E5>): Observable<V2, E2>;
|
|
15
|
+
}
|
|
16
|
+
export interface SubscriptionLike extends Unsubscribable {
|
|
17
|
+
unsubscribe(): void;
|
|
18
|
+
readonly closed: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface Observer<TValue, TError> {
|
|
21
|
+
next: (value: TValue) => void;
|
|
22
|
+
error: (err: TError) => void;
|
|
23
|
+
complete: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare type TeardownLogic = Unsubscribable | UnsubscribeFn | void;
|
|
26
|
+
export declare type UnaryFunction<T, R> = (source: T) => R;
|
|
27
|
+
export declare type OperatorFunction<TValueBefore, TErrorBefore, TValueAfter, TErrorAfter> = UnaryFunction<Subscribable<TValueBefore, TErrorBefore>, Subscribable<TValueAfter, TErrorAfter>>;
|
|
28
|
+
export declare type MonoTypeOperatorFunction<TValue, TError> = OperatorFunction<TValue, TError, TValue, TError>;
|
|
29
29
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/rx/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function identity<T>(x: T): T;
|
|
1
|
+
export declare function identity<T>(x: T): T;
|
|
2
2
|
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/rx/util/identity.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAEnC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Observable } from '../types';
|
|
2
|
-
export declare class ObservableAbortError extends Error {
|
|
3
|
-
constructor(message: string);
|
|
4
|
-
}
|
|
5
|
-
/** @internal */
|
|
6
|
-
export declare function observableToPromise<TValue>(observable: Observable<TValue, unknown>): {
|
|
7
|
-
promise: Promise<TValue>;
|
|
8
|
-
abort: () => void;
|
|
9
|
-
};
|
|
1
|
+
import { Observable } from '../types';
|
|
2
|
+
export declare class ObservableAbortError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare function observableToPromise<TValue>(observable: Observable<TValue, unknown>): {
|
|
7
|
+
promise: Promise<TValue>;
|
|
8
|
+
abort: () => void;
|
|
9
|
+
};
|
|
10
10
|
//# sourceMappingURL=observableToPromise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observableToPromise.d.ts","sourceRoot":"","sources":["../../../src/rx/util/observableToPromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAK5B;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,CAAC,MAAM,EACxC,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC;;iBAEtB,IAAI;EAkCtB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UnaryFunction } from '../types';
|
|
2
|
-
/** @internal */
|
|
3
|
-
export declare function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R>;
|
|
1
|
+
import { UnaryFunction } from '../types';
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R>;
|
|
4
4
|
//# sourceMappingURL=pipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe.d.ts","sourceRoot":"","sources":["../../../src/rx/util/pipe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,gBAAgB;AAChB,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,EAChC,GAAG,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAC9B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAerB"}
|