@ic-reactor/react 1.7.0 → 1.7.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.
@@ -139,12 +139,16 @@ const actorHooks = (actorManager) => {
139
139
  const _b = useSharedCall(rest), { call } = _b, state = __rest(_b, ["call"]);
140
140
  const intervalId = React.useRef();
141
141
  React.useEffect(() => {
142
+ var _a;
142
143
  if (refetchInterval) {
143
144
  intervalId.current = setInterval(call, refetchInterval);
144
145
  }
145
146
  if (refetchOnMount && state.data === undefined) {
146
147
  call();
147
148
  }
149
+ else if (refetchOnMount && state.data !== undefined) {
150
+ (_a = rest.onSuccess) === null || _a === void 0 ? void 0 : _a.call(rest, state.data);
151
+ }
148
152
  return () => clearInterval(intervalId.current);
149
153
  }, [refetchInterval, refetchOnMount]);
150
154
  return Object.assign({ call }, state);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/react",
3
- "version": "1.7.0",
3
+ "version": "1.7.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",
@@ -35,7 +35,7 @@
35
35
  "node": ">=10"
36
36
  },
37
37
  "dependencies": {
38
- "@ic-reactor/core": "^1.7.0",
38
+ "@ic-reactor/core": "^1.7.1",
39
39
  "zustand-utils": "^1.3"
40
40
  },
41
41
  "peerDependencies": {
@@ -47,5 +47,5 @@
47
47
  "react": ">=16.8",
48
48
  "zustand": "4.5"
49
49
  },
50
- "gitHead": "0fac1036d11ae1b2498e6568d5eff514bd657116"
50
+ "gitHead": "d4013e2399602abb8646efad8bb564934a254b23"
51
51
  }