@ic-reactor/core 0.3.5 → 0.4.0

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/index.d.ts CHANGED
@@ -2,8 +2,9 @@ import type { CreateReActorOptions } from "@ic-reactor/store";
2
2
  import { ActorQuery, ActorUpdate } from "./types";
3
3
  export declare const createReActor: <A extends unknown>(options: CreateReActorOptions) => {
4
4
  canisterId: import("@ic-reactor/store").CanisterId;
5
- methodFields: import("@ic-reactor/store").ActorMethodField<A>[];
5
+ serviceFields: import("@ic-reactor/store").ExtractedService<A>;
6
6
  unsubscribeActor: () => void;
7
+ initialize: (options?: import("@ic-reactor/store").UpdateAgentOptions | undefined) => Promise<void>;
7
8
  updateMethodState: (newState: Partial<import("@ic-reactor/store").ActorMethodStates<A>>) => void;
8
9
  subscribeAgent: (callback: (agent: import("@ic-reactor/store").HttpAgent) => void) => () => void;
9
10
  unsubscribeAgent: (callback: (agent: import("@ic-reactor/store").HttpAgent) => void) => void;
@@ -11,7 +12,7 @@ export declare const createReActor: <A extends unknown>(options: CreateReActorOp
11
12
  authenticate: () => Promise<void>;
12
13
  getAgent: () => import("@ic-reactor/store").HttpAgent;
13
14
  actorStore: import("@ic-reactor/store").ActorStore<A>;
14
- authStore: import("@ic-reactor/store").AuthenticateStore;
15
+ authStore: import("@ic-reactor/store").AgentAuthStore;
15
16
  queryCall: ActorQuery<A>;
16
17
  updateCall: ActorUpdate<A>;
17
18
  };
package/dist/index.js CHANGED
@@ -104,7 +104,7 @@ const createReActor = (options) => {
104
104
  throw error;
105
105
  }
106
106
  };
107
- const queryCall = ({ functionName, args = [], disableInitialCall = false, autoRefresh = false, refreshInterval = 5000, }) => {
107
+ const queryCall = ({ functionName, args = [], callOnMount = false, autoRefresh = false, refreshInterval = 5000, }) => {
108
108
  let intervalId = null;
109
109
  const _a = reActorMethod(functionName, ...args), { call } = _a, rest = __rest(_a, ["call"]);
110
110
  if (autoRefresh) {
@@ -113,7 +113,7 @@ const createReActor = (options) => {
113
113
  }, refreshInterval);
114
114
  }
115
115
  let initialData = Promise.resolve();
116
- if (!disableInitialCall)
116
+ if (callOnMount)
117
117
  initialData = call();
118
118
  return Object.assign(Object.assign({}, rest), { call, initialData, intervalId });
119
119
  };
package/dist/types.d.ts CHANGED
@@ -25,7 +25,7 @@ export type ActorUpdateReturn<A, M extends keyof A> = {
25
25
  export type ActorQueryArgs<A, M extends keyof A> = {
26
26
  functionName: M;
27
27
  args?: ExtractActorMethodArgs<A[M]>;
28
- disableInitialCall?: boolean;
28
+ callOnMount?: boolean;
29
29
  autoRefresh?: boolean;
30
30
  refreshInterval?: number;
31
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/core",
3
- "version": "0.3.5",
3
+ "version": "0.4.0",
4
4
  "description": "A React library for interacting with Dfinity actors",
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/store": "^0.3.5"
38
+ "@ic-reactor/store": "^0.4.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@dfinity/agent": "^0.20",
@@ -46,5 +46,5 @@
46
46
  "@peculiar/webcrypto": "1.4",
47
47
  "zustand": "4.4"
48
48
  },
49
- "gitHead": "2e01a26ea775885343887081ddff152944b6e9b2"
49
+ "gitHead": "b91b8bec6e0329d0a7cde22014d9222814311f23"
50
50
  }