@ic-reactor/react 1.8.0 → 1.8.1
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.
|
@@ -52,8 +52,6 @@ function createAdapterContext(config = {}) {
|
|
|
52
52
|
return candidAdapter.validateIDL(candidString);
|
|
53
53
|
}
|
|
54
54
|
catch (err) {
|
|
55
|
-
// eslint-disable-next-line no-console
|
|
56
|
-
console.error(err);
|
|
57
55
|
setState({
|
|
58
56
|
fetchError: `Error validating Candid definition, ${err}`,
|
|
59
57
|
fetching: false,
|
|
@@ -68,13 +66,15 @@ function createAdapterContext(config = {}) {
|
|
|
68
66
|
try {
|
|
69
67
|
const definition = yield candidAdapter.dynamicEvalJs(candidString);
|
|
70
68
|
if (typeof (definition === null || definition === void 0 ? void 0 : definition.idlFactory) !== "function") {
|
|
71
|
-
throw new Error("
|
|
69
|
+
throw new Error("No Function found in Candid definition!");
|
|
72
70
|
}
|
|
71
|
+
setState({
|
|
72
|
+
fetchError: null,
|
|
73
|
+
fetching: false,
|
|
74
|
+
});
|
|
73
75
|
return definition.idlFactory;
|
|
74
76
|
}
|
|
75
77
|
catch (err) {
|
|
76
|
-
// eslint-disable-next-line no-console
|
|
77
|
-
console.error(err);
|
|
78
78
|
setState({
|
|
79
79
|
fetchError: `Error evaluating Candid definition, ${err}`,
|
|
80
80
|
fetching: false,
|
package/dist/hooks/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IDL, ActorHooksReturnType, ActorManagerParameters, BaseActor, CanisterId } from "../types";
|
|
2
|
-
export
|
|
2
|
+
export type ActorReConfigParameters = Omit<ActorManagerParameters, "idlFactory" | "canisterId" | "agentManager">;
|
|
3
|
+
export interface UseActorParameters extends ActorReConfigParameters {
|
|
3
4
|
candidString?: string;
|
|
4
5
|
canisterId: CanisterId;
|
|
5
6
|
idlFactory?: IDL.InterfaceFactory;
|
|
@@ -12,4 +13,4 @@ export interface UseActorReturn<A = BaseActor> {
|
|
|
12
13
|
authenticating: boolean;
|
|
13
14
|
initializeActor: InitializeActor;
|
|
14
15
|
}
|
|
15
|
-
export type InitializeActor = (idlFactory: IDL.InterfaceFactory, actorReConfig?:
|
|
16
|
+
export type InitializeActor = (idlFactory: IDL.InterfaceFactory, actorReConfig?: ActorReConfigParameters) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ic-reactor/react",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "A React library for interacting with Internet Computer canisters",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"react": ">=16.8",
|
|
48
48
|
"zustand": "4.5"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "7d1a090ce85775c0f033a75e3ddfb127b70a540b"
|
|
51
51
|
}
|