@graphql-box/worker-client 5.4.2 → 5.4.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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/production.analysis.txt +17 -17
- package/dist/types/cjs/main.d.cts.map +1 -1
- package/dist/types/cjs/types.d.cts +1 -1
- package/dist/types/cjs/types.d.cts.map +1 -1
- package/dist/types/esm/main.d.ts.map +1 -1
- package/dist/types/esm/types.d.ts +1 -1
- package/dist/types/esm/types.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/main.ts +1 -3
- package/src/types.ts +1 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-box/worker-client",
|
|
3
3
|
"description": "The GraphQL Box web worker client module.",
|
|
4
|
-
"version": "5.4.
|
|
4
|
+
"version": "5.4.3",
|
|
5
5
|
"author": "Dylan Aubrey",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/badbatch/graphql-box",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"iterall": "^1.3.0",
|
|
42
42
|
"lodash-es": "^4.17.21",
|
|
43
43
|
"uuid": "^11.0.3",
|
|
44
|
-
"@graphql-box/
|
|
45
|
-
"@graphql-box/
|
|
44
|
+
"@graphql-box/core": "5.4.0",
|
|
45
|
+
"@graphql-box/helpers": "5.4.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"graphql": "<17",
|
package/src/main.ts
CHANGED
|
@@ -102,7 +102,6 @@ export class WorkerClient {
|
|
|
102
102
|
private _experimentalDeferStreamSupport: boolean;
|
|
103
103
|
private _messageQueue: MessageRequestPayload[] = [];
|
|
104
104
|
private _pending: PendingTracker = new Map();
|
|
105
|
-
|
|
106
105
|
private _worker: Worker | undefined;
|
|
107
106
|
|
|
108
107
|
constructor(options: UserOptions) {
|
|
@@ -130,8 +129,7 @@ export class WorkerClient {
|
|
|
130
129
|
this._experimentalDeferStreamSupport = options.experimentalDeferStreamSupport ?? false;
|
|
131
130
|
|
|
132
131
|
if (typeof options.worker === 'function') {
|
|
133
|
-
options
|
|
134
|
-
.worker()
|
|
132
|
+
Promise.resolve(options.worker())
|
|
135
133
|
.then(worker => {
|
|
136
134
|
this._worker = worker;
|
|
137
135
|
this._addEventListener();
|
package/src/types.ts
CHANGED
|
@@ -12,22 +12,19 @@ export interface UserOptions {
|
|
|
12
12
|
* The cache.
|
|
13
13
|
*/
|
|
14
14
|
cache: CoreWorker;
|
|
15
|
-
|
|
16
15
|
/**
|
|
17
16
|
* The debug manager.
|
|
18
17
|
*/
|
|
19
18
|
debugManager?: DebugManagerDef;
|
|
20
|
-
|
|
21
19
|
/**
|
|
22
20
|
* Enable support for defer and stream directives. Based on version
|
|
23
21
|
* of spec in 16.1.0-experimental-stream-defer.6
|
|
24
22
|
*/
|
|
25
23
|
experimentalDeferStreamSupport?: boolean;
|
|
26
|
-
|
|
27
24
|
/**
|
|
28
25
|
* The web worker instance.
|
|
29
26
|
*/
|
|
30
|
-
worker: Worker | (() => Promise<Worker>);
|
|
27
|
+
worker: Worker | (() => Worker | Promise<Worker>);
|
|
31
28
|
}
|
|
32
29
|
|
|
33
30
|
export type MethodNames = 'request' | 'subscribe';
|