-
Notifications
You must be signed in to change notification settings - Fork 156
/
Copy path@credo-ts-react-hooks-npm-0.6.0-3c59ce13d2.patch
445 lines (445 loc) · 23 KB
/
@credo-ts-react-hooks-npm-0.6.0-3c59ce13d2.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
diff --git a/build/AgentProvider.d.ts b/build/AgentProvider.d.ts
index 1c1c0c867f21d899f62bf99725925ffe0084be91..7e73e3db8e8623299db2dbdfae964b21f699827e 100644
--- a/build/AgentProvider.d.ts
+++ b/build/AgentProvider.d.ts
@@ -3,11 +3,13 @@ import type { PropsWithChildren } from 'react';
import * as React from 'react';
interface AgentContextInterface<AppAgent extends Agent = Agent> {
loading: boolean;
- agent: AppAgent;
+ agent?: AppAgent;
+ setAgent(agent: AppAgent): void;
+ agentIteration: number;
}
export declare const useAgent: <AppAgent extends Agent<any>>() => AgentContextInterface<AppAgent>;
interface Props {
- agent: Agent;
+ agent: Agent | undefined;
}
declare const AgentProvider: React.FC<PropsWithChildren<Props>>;
export default AgentProvider;
diff --git a/build/AgentProvider.js b/build/AgentProvider.js
index 2f4560a13ca0271da8c8178a269a3288768eed5a..da3a384f534594060359c275d41181cc601d1b20 100644
--- a/build/AgentProvider.js
+++ b/build/AgentProvider.js
@@ -48,18 +48,27 @@ const useAgent = () => {
};
exports.useAgent = useAgent;
const AgentProvider = ({ agent, children }) => {
- const isQaRegistered = (0, recordUtils_1.useIsModuleRegistered)(agent, question_answer_1.QuestionAnswerModule);
- const [agentState] = (0, react_1.useState)({
- loading: false,
+ const [agentState, setAgentState] = (0, react_1.useState)({
+ loading: true,
agent,
+ agentIteration: 1,
});
- return (React.createElement(AgentContext.Provider, { value: agentState },
- React.createElement(ConnectionProvider_1.default, { agent: agent },
- React.createElement(CredentialProvider_1.default, { agent: agent },
- React.createElement(ProofProvider_1.default, { agent: agent },
- React.createElement(CredentialFormatDataProvider_1.default, { agent: agent },
- React.createElement(ProofFormatDataProvider_1.default, { agent: agent },
- React.createElement(BasicMessageProvider_1.default, { agent: agent }, isQaRegistered ? (React.createElement(QuestionAnswerProvider_1.default, { agent: agent },
+ const isQaRegistered = (0, recordUtils_1.useIsModuleRegistered)(agentState.agent, question_answer_1.QuestionAnswerModule);
+ const setInitialState = async (newAgent) => {
+ if (!newAgent)
+ return;
+ setAgentState(prev => ({ agent: newAgent, loading: false, agentIteration: prev.agentIteration + 1 }));
+ };
+ React.useEffect(() => {
+ setInitialState();
+ }, [agentState.agent]);
+ return (React.createElement(AgentContext.Provider, { value: { agent: agentState.agent, agentIteration: agentState.agentIteration, loading: agentState.agent ? false : true, setAgent: setInitialState } },
+ React.createElement(ConnectionProvider_1.default, { agent: agentState.agent, agentIteration: agentState.agentIteration },
+ React.createElement(CredentialProvider_1.default, { agent: agentState.agent, agentIteration: agentState.agentIteration },
+ React.createElement(ProofProvider_1.default, { agent: agentState.agent, agentIteration: agentState.agentIteration },
+ React.createElement(CredentialFormatDataProvider_1.default, { agent: agentState.agent, agentIteration: agentState.agentIteration },
+ React.createElement(ProofFormatDataProvider_1.default, { agent: agentState.agent, agentIteration: agentState.agentIteration },
+ React.createElement(BasicMessageProvider_1.default, { agent: agentState.agent, agentIteration: agentState.agentIteration }, isQaRegistered ? (React.createElement(QuestionAnswerProvider_1.default, { agent: agentState.agent, agentIteration: agentState.agentIteration },
children,
" ")) : (children)))))))));
};
diff --git a/build/BasicMessageProvider.d.ts b/build/BasicMessageProvider.d.ts
index 20a12947d1972a8fb50cb2110f0c60749e2e8b7c..c5caaed382213c800084d24dd4ef66ef0ae3d5c6 100644
--- a/build/BasicMessageProvider.d.ts
+++ b/build/BasicMessageProvider.d.ts
@@ -6,7 +6,8 @@ import * as React from 'react';
export declare const useBasicMessages: () => RecordsState<BasicMessageRecord>;
export declare const useBasicMessagesByConnectionId: (connectionId: string) => BasicMessageRecord[];
interface Props {
- agent: Agent;
+ agent: Agent | undefined;
+ agentIteration: number;
}
declare const BasicMessageProvider: React.FC<PropsWithChildren<Props>>;
export default BasicMessageProvider;
diff --git a/build/BasicMessageProvider.js b/build/BasicMessageProvider.js
index c3e2f44cf8bd564ce51c51c65eba15ac2dba4285..28686a5bb6f2adfba758462d38a8e3dc3b03d902 100644
--- a/build/BasicMessageProvider.js
+++ b/build/BasicMessageProvider.js
@@ -43,12 +43,15 @@ const useBasicMessagesByConnectionId = (connectionId) => {
return messages;
};
exports.useBasicMessagesByConnectionId = useBasicMessagesByConnectionId;
-const BasicMessageProvider = ({ agent, children }) => {
+const BasicMessageProvider = ({ agent, agentIteration, children }) => {
const [state, setState] = (0, react_1.useState)({
records: [],
loading: true,
});
const setInitialState = async () => {
+ setState(prev => ({ ...prev, loading: true }));
+ if (!agent)
+ return;
const records = await agent.basicMessages.findAllByQuery({});
setState({ records, loading: false });
};
@@ -66,7 +69,7 @@ const BasicMessageProvider = ({ agent, children }) => {
basicMessageUpdated$ === null || basicMessageUpdated$ === void 0 ? void 0 : basicMessageUpdated$.unsubscribe();
basicMessageRemoved$ === null || basicMessageRemoved$ === void 0 ? void 0 : basicMessageRemoved$.unsubscribe();
};
- }, [state, agent]);
+ }, [state, agent, agentIteration]);
return React.createElement(BasicMessageContext.Provider, { value: state }, children);
};
exports.default = BasicMessageProvider;
diff --git a/build/ConnectionProvider.d.ts b/build/ConnectionProvider.d.ts
index 42d8b4772eabb9342ef0ba71ddef9007ea04238b..7dcbaa10315cfca45f9d776a64d599931b785723 100644
--- a/build/ConnectionProvider.d.ts
+++ b/build/ConnectionProvider.d.ts
@@ -18,7 +18,8 @@ export declare const useConnections: (options?: UseConnectionsOptions) => {
};
export declare const useConnectionById: (id: string) => ConnectionRecord | undefined;
interface Props {
- agent: Agent;
+ agent: Agent | undefined;
+ agentIteration: number;
}
declare const ConnectionProvider: React.FC<PropsWithChildren<Props>>;
export default ConnectionProvider;
diff --git a/build/ConnectionProvider.js b/build/ConnectionProvider.js
index aa461a803ee740a756989464640538e735de2c52..d6c4b852a2c282a31c55fba01d828c6a877cb309 100644
--- a/build/ConnectionProvider.js
+++ b/build/ConnectionProvider.js
@@ -66,12 +66,15 @@ const useConnectionById = (id) => {
return connections.find((c) => c.id === id);
};
exports.useConnectionById = useConnectionById;
-const ConnectionProvider = ({ agent, children }) => {
+const ConnectionProvider = ({ agent, agentIteration, children }) => {
const [state, setState] = (0, react_1.useState)({
records: [],
loading: true,
});
const setInitialState = async () => {
+ setState(prev => ({ ...prev, loading: true }));
+ if (!agent)
+ return;
const records = await agent.connections.getAll();
setState({ records, loading: false });
};
@@ -89,7 +92,7 @@ const ConnectionProvider = ({ agent, children }) => {
connectionUpdated$.unsubscribe();
connectionRemoved$.unsubscribe();
};
- }, [state, agent]);
+ }, [state, agent, agentIteration]);
return React.createElement(ConnectionContext.Provider, { value: state }, children);
};
exports.default = ConnectionProvider;
diff --git a/build/CredentialFormatDataProvider.d.ts b/build/CredentialFormatDataProvider.d.ts
index 0d129f9aef9f897eb57f517dd831749e1a20fd04..f2d3e5d108647d13df30256643028f3b27890f75 100644
--- a/build/CredentialFormatDataProvider.d.ts
+++ b/build/CredentialFormatDataProvider.d.ts
@@ -13,7 +13,8 @@ type FormattedDataState = {
export declare const useCredentialsFormatData: () => FormattedDataState;
export declare const useCredentialFormatDataById: (id: string) => CredentialFormatData | undefined;
interface Props {
- agent: Agent;
+ agent: Agent | undefined;
+ agentIteration: number;
}
declare const CredentialFormatDataProvider: React.FC<PropsWithChildren<Props>>;
export default CredentialFormatDataProvider;
diff --git a/build/CredentialFormatDataProvider.js b/build/CredentialFormatDataProvider.js
index e42643767e2f37e1b9b8ccb343dadaf7a0f18a26..024ae350628a881c2d905d29df0a87f6262bc94d 100644
--- a/build/CredentialFormatDataProvider.js
+++ b/build/CredentialFormatDataProvider.js
@@ -67,7 +67,7 @@ const useCredentialFormatDataById = (id) => {
return formattedData.find((c) => c.id === id);
};
exports.useCredentialFormatDataById = useCredentialFormatDataById;
-const CredentialFormatDataProvider = ({ agent, children }) => {
+const CredentialFormatDataProvider = ({ agent, agentIteration, children }) => {
const [state, setState] = (0, react_1.useState)({
formattedData: [],
loading: true,
@@ -77,6 +77,9 @@ const CredentialFormatDataProvider = ({ agent, children }) => {
return Object.assign(Object.assign({}, formatData), { id: record.id });
};
const setInitialState = async () => {
+ setState(prev => ({ ...prev, loading: true }));
+ if (!agent)
+ return;
const records = await agent.credentials.getAll();
const formattedData = [];
for (const record of records) {
@@ -91,10 +94,14 @@ const CredentialFormatDataProvider = ({ agent, children }) => {
if (state.loading)
return;
const credentialAdded$ = (0, recordUtils_1.recordsAddedByType)(agent, core_1.CredentialExchangeRecord).subscribe(async (record) => {
+ if (!agent)
+ return;
const formatData = await fetchCredentialInformation(agent, record);
setState(addRecord(formatData, state));
});
const credentialUpdate$ = (0, recordUtils_1.recordsUpdatedByType)(agent, core_1.CredentialExchangeRecord).subscribe(async (record) => {
+ if (!agent)
+ return;
const formatData = await fetchCredentialInformation(agent, record);
setState(updateRecord(formatData, state));
});
@@ -104,7 +111,7 @@ const CredentialFormatDataProvider = ({ agent, children }) => {
credentialUpdate$.unsubscribe();
credentialRemove$.unsubscribe();
};
- }, [state, agent]);
+ }, [state, agent, agentIteration]);
return react_1.default.createElement(CredentialFormatDataContext.Provider, { value: state }, children);
};
exports.default = CredentialFormatDataProvider;
diff --git a/build/CredentialProvider.d.ts b/build/CredentialProvider.d.ts
index 553364cef8798db59dcc1d2cf9671f935d1ee346..3c80bccfddda095e6617ab1f37c2ca4a4bb14390 100644
--- a/build/CredentialProvider.d.ts
+++ b/build/CredentialProvider.d.ts
@@ -9,7 +9,8 @@ export declare const useCredentialById: (id: string) => CredentialExchangeRecord
export declare const useCredentialByState: (state: CredentialState | CredentialState[]) => CredentialExchangeRecord[];
export declare const useCredentialNotInState: (state: CredentialState | CredentialState[]) => CredentialExchangeRecord[];
interface Props {
- agent: Agent;
+ agent: Agent | undefined;
+ agentIteration: number;
}
declare const CredentialProvider: React.FC<PropsWithChildren<Props>>;
export default CredentialProvider;
diff --git a/build/CredentialProvider.js b/build/CredentialProvider.js
index 0cabe89193d87c2f08f1f897b31fbc393cc2a6d5..bb7bd251ee9dff38aa5d74955064aaadb5bff601 100644
--- a/build/CredentialProvider.js
+++ b/build/CredentialProvider.js
@@ -61,12 +61,15 @@ const useCredentialNotInState = (state) => {
return filteredCredentials;
};
exports.useCredentialNotInState = useCredentialNotInState;
-const CredentialProvider = ({ agent, children }) => {
+const CredentialProvider = ({ agent, agentIteration, children }) => {
const [state, setState] = (0, react_1.useState)({
records: [],
loading: true,
});
const setInitialState = async () => {
+ setState(prev => ({ ...prev, loading: true }));
+ if (!agent)
+ return;
const records = await agent.credentials.getAll();
setState({ records, loading: false });
};
@@ -84,7 +87,7 @@ const CredentialProvider = ({ agent, children }) => {
credentialUpdated$ === null || credentialUpdated$ === void 0 ? void 0 : credentialUpdated$.unsubscribe();
credentialRemoved$ === null || credentialRemoved$ === void 0 ? void 0 : credentialRemoved$.unsubscribe();
};
- }, [state, agent]);
+ }, [state, agent, agentIteration]);
return React.createElement(CredentialContext.Provider, { value: state }, children);
};
exports.default = CredentialProvider;
diff --git a/build/ExchangesProvider.js b/build/ExchangesProvider.js
index 9824a51b2347d12bea268401cca2694bf33c847e..8276a10ce446083da67ab2b94beaa6f92161ee6a 100644
--- a/build/ExchangesProvider.js
+++ b/build/ExchangesProvider.js
@@ -51,6 +51,7 @@ const ExchangesProvider = ({ agent, children }) => {
loading: true,
});
const setInitialState = () => {
+ setState(prev => ({ ...prev, loading: true }));
const { records: basicMessages } = (0, BasicMessageProvider_1.useBasicMessages)();
const { records: proofs } = (0, ProofProvider_1.useProofs)();
const { records: credentials } = (0, CredentialProvider_1.useCredentials)();
diff --git a/build/ProofFormatDataProvider.d.ts b/build/ProofFormatDataProvider.d.ts
index 3ea0c4942baf415938c9e316a60b89e99fe930fa..a5373362f58554765d8976daf0aa10b69e5d7f19 100644
--- a/build/ProofFormatDataProvider.d.ts
+++ b/build/ProofFormatDataProvider.d.ts
@@ -13,7 +13,8 @@ type FormattedProofDataState = {
export declare const useProofsFormatData: () => FormattedProofDataState;
export declare const useProofFormatDataById: (id: string) => ProofFormatData | undefined;
interface Props {
- agent: Agent;
+ agent: Agent | undefined;
+ agentIteration: number;
}
declare const ProofFormatDataProvider: React.FC<PropsWithChildren<Props>>;
export default ProofFormatDataProvider;
diff --git a/build/ProofFormatDataProvider.js b/build/ProofFormatDataProvider.js
index 331fc7c90a7b0b64d15ce2e9e8346c7234ef8370..ffc8864e084e0d06eb2b9ee629d627de82e48eea 100644
--- a/build/ProofFormatDataProvider.js
+++ b/build/ProofFormatDataProvider.js
@@ -68,12 +68,15 @@ const useProofFormatDataById = (id) => {
return formattedData.find((c) => c.id === id);
};
exports.useProofFormatDataById = useProofFormatDataById;
-const ProofFormatDataProvider = ({ agent, children }) => {
+const ProofFormatDataProvider = ({ agent, agentIteration, children }) => {
const [state, setState] = (0, react_1.useState)({
formattedData: [],
loading: true,
});
const setInitialState = async () => {
+ setState(prev => ({ ...prev, loading: true }));
+ if (!agent)
+ return;
const records = await agent.proofs.getAll();
const formattedData = [];
for (const record of records) {
@@ -89,10 +92,14 @@ const ProofFormatDataProvider = ({ agent, children }) => {
if (state.loading)
return;
const proofAdded$ = (0, recordUtils_1.recordsAddedByType)(agent, core_1.ProofExchangeRecord).subscribe(async (record) => {
+ if (!agent)
+ return;
const formatData = await agent.proofs.getFormatData(record.id);
setState(addRecord(Object.assign(Object.assign({}, formatData), { id: record.id }), state));
});
const proofUpdate$ = (0, recordUtils_1.recordsUpdatedByType)(agent, core_1.ProofExchangeRecord).subscribe(async (record) => {
+ if (!agent)
+ return;
const formatData = await agent.proofs.getFormatData(record.id);
setState(updateRecord(Object.assign(Object.assign({}, formatData), { id: record.id }), state));
});
@@ -102,7 +109,7 @@ const ProofFormatDataProvider = ({ agent, children }) => {
proofUpdate$.unsubscribe();
proofRemove$.unsubscribe();
};
- }, [state, agent]);
+ }, [state, agent, agentIteration]);
return React.createElement(ProofFormatDataContext.Provider, { value: state }, children);
};
exports.default = ProofFormatDataProvider;
diff --git a/build/ProofProvider.d.ts b/build/ProofProvider.d.ts
index 642e9d45565f61fac1d086fe0966a4db1bd91edd..2c1af9fbae1ae20a9240eea717f89db499e3f59e 100644
--- a/build/ProofProvider.d.ts
+++ b/build/ProofProvider.d.ts
@@ -9,7 +9,8 @@ export declare const useProofById: (id: string) => ProofExchangeRecord | undefin
export declare const useProofByState: (state: ProofState | ProofState[]) => ProofExchangeRecord[];
export declare const useProofNotInState: (state: ProofState | ProofState[]) => ProofExchangeRecord[];
interface Props {
- agent: Agent;
+ agent: Agent | undefined;
+ agentIteration: number;
}
declare const ProofProvider: React.FC<PropsWithChildren<Props>>;
export default ProofProvider;
diff --git a/build/ProofProvider.js b/build/ProofProvider.js
index a620fe6f6a8b90bff0fd26f683a68f47925f0e9b..ad8a2405e8e9fd9ecec8d712b7e68e0dca37784a 100644
--- a/build/ProofProvider.js
+++ b/build/ProofProvider.js
@@ -67,12 +67,15 @@ const useProofNotInState = (state) => {
return filteredProofs;
};
exports.useProofNotInState = useProofNotInState;
-const ProofProvider = ({ agent, children }) => {
+const ProofProvider = ({ agent, agentIteration, children }) => {
const [state, setState] = (0, react_1.useState)({
records: [],
loading: true,
});
const setInitialState = async () => {
+ setState(prev => ({ ...prev, loading: true }));
+ if (!agent)
+ return;
const records = await agent.proofs.getAll();
setState({ records, loading: false });
};
@@ -90,7 +93,7 @@ const ProofProvider = ({ agent, children }) => {
proofUpdated$ === null || proofUpdated$ === void 0 ? void 0 : proofUpdated$.unsubscribe();
proofRemoved$ === null || proofRemoved$ === void 0 ? void 0 : proofRemoved$.unsubscribe();
};
- }, [state, agent]);
+ }, [state, agent, agentIteration]);
return React.createElement(ProofContext.Provider, { value: state }, children);
};
exports.default = ProofProvider;
diff --git a/build/QuestionAnswerProvider.d.ts b/build/QuestionAnswerProvider.d.ts
index 95a6c38861bdf71d46ba145c50000150c664a2f6..f6d918083feaf75a81d2d9bce7f4666ebf4bf710 100644
--- a/build/QuestionAnswerProvider.d.ts
+++ b/build/QuestionAnswerProvider.d.ts
@@ -8,7 +8,8 @@ export declare const useQuestionAnswer: () => {
export declare const useQuestionAnswerByConnectionId: (connectionId: string) => QuestionAnswerRecord[];
export declare const useQuestionAnswerById: (id: string) => QuestionAnswerRecord | undefined;
interface Props {
- agent: Agent;
+ agent: Agent | undefined;
+ agentIteration: number;
}
declare const QuestionAnswerProvider: React.FC<PropsWithChildren<Props>>;
export default QuestionAnswerProvider;
diff --git a/build/QuestionAnswerProvider.js b/build/QuestionAnswerProvider.js
index 4abe2463e0f629556b55a7ac4cb7cf4fce81a327..92e6f2287fe1434810274c9cbf44e92a70b6331d 100644
--- a/build/QuestionAnswerProvider.js
+++ b/build/QuestionAnswerProvider.js
@@ -47,12 +47,15 @@ const useQuestionAnswerById = (id) => {
return questionAnswerMessages.find((c) => c.id === id);
};
exports.useQuestionAnswerById = useQuestionAnswerById;
-const QuestionAnswerProvider = ({ agent, children }) => {
+const QuestionAnswerProvider = ({ agent, agentIteration, children }) => {
const [questionAnswerState, setQuestionAnswerState] = (0, react_1.useState)({
questionAnswerMessages: [],
loading: true,
});
const setInitialState = async () => {
+ setQuestionAnswerState(prev => ({ ...prev, loading: true }));
+ if (!agent)
+ return;
const questAnswerApi = agent.dependencyManager.resolve(question_answer_1.QuestionAnswerApi);
const questionAnswerMessages = await questAnswerApi.getAll();
setQuestionAnswerState({ questionAnswerMessages, loading: false });
@@ -77,11 +80,11 @@ const QuestionAnswerProvider = ({ agent, children }) => {
questionAnswerMessages: newQuestionAnswerState,
});
};
- agent.events.on(question_answer_1.QuestionAnswerEventTypes.QuestionAnswerStateChanged, listener);
+ agent === null || agent === void 0 ? void 0 : agent.events.on(question_answer_1.QuestionAnswerEventTypes.QuestionAnswerStateChanged, listener);
return () => {
- agent.events.off(question_answer_1.QuestionAnswerEventTypes.QuestionAnswerStateChanged, listener);
+ agent === null || agent === void 0 ? void 0 : agent.events.off(question_answer_1.QuestionAnswerEventTypes.QuestionAnswerStateChanged, listener);
};
- }, [questionAnswerState, agent]);
+ }, [questionAnswerState, agent, agentIteration]);
return React.createElement(QuestionAnswerContext.Provider, { value: questionAnswerState }, children);
};
exports.default = QuestionAnswerProvider;
diff --git a/build/recordUtils.d.ts b/build/recordUtils.d.ts
index 7b5c5d109011a1e950157b04eafa886312b07341..752daab30a00c6848861a04774a1fe7e5c294872 100644
--- a/build/recordUtils.d.ts
+++ b/build/recordUtils.d.ts
@@ -18,5 +18,5 @@ export declare const recordsAddedByType: <R extends BaseRecordAny>(agent: Agent
export declare const recordsUpdatedByType: <R extends BaseRecordAny>(agent: Agent | undefined, recordClass: RecordClass<R>) => import("rxjs").Observable<R>;
export declare const recordsRemovedByType: <R extends BaseRecordAny>(agent: Agent | undefined, recordClass: RecordClass<R>) => import("rxjs").Observable<R>;
export declare const isModuleRegistered: (agent: Agent, ModuleClass: Constructor) => boolean;
-export declare const useIsModuleRegistered: (agent: Agent, ModuleClass: Constructor) => boolean;
+export declare const useIsModuleRegistered: (agent: Agent | undefined, ModuleClass: Constructor) => boolean | undefined;
export {};
diff --git a/build/recordUtils.js b/build/recordUtils.js
index 5fcf63af4d1790d4de9c93a7c5726e0d97fdf491..e6a5a553877230a09598cd6eb32e3274ae6f1699 100644
--- a/build/recordUtils.js
+++ b/build/recordUtils.js
@@ -75,7 +75,7 @@ const isModuleRegistered = (agent, ModuleClass) => {
};
exports.isModuleRegistered = isModuleRegistered;
const useIsModuleRegistered = (agent, ModuleClass) => {
- return (0, react_1.useMemo)(() => (0, exports.isModuleRegistered)(agent, ModuleClass), [agent, ModuleClass]);
+ return (0, react_1.useMemo)(() => (agent ? (0, exports.isModuleRegistered)(agent, ModuleClass) : undefined), [agent, ModuleClass]);
};
exports.useIsModuleRegistered = useIsModuleRegistered;
//# sourceMappingURL=recordUtils.js.map
\ No newline at end of file