@ic-reactor/react 0.2.2 → 0.2.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/hooks.d.ts CHANGED
@@ -1,16 +1,12 @@
1
1
  import { CallMethod, ExtractReActorMethodArgs, ReActorActorStore, ReActorMethodField } from "@ic-reactor/store";
2
2
  import { ReActorUseQueryArgs, ReActorUseUpdateArgs } from "./types";
3
3
  export declare const getCallHooks: <A extends unknown>(callMethod: CallMethod<A>, actorStore: ReActorActorStore<A>) => {
4
- useField: (functionName: keyof A & string) => {
5
- current: ReActorMethodField<A> | undefined;
6
- };
4
+ useField: (functionName: keyof A & string) => ReActorMethodField<A> | undefined;
7
5
  useQueryCall: <M extends keyof A>({ autoRefresh, refreshInterval, disableInitialCall, ...rest }: ReActorUseQueryArgs<A, M>) => {
8
6
  data: import("@ic-reactor/store").ExtractReActorMethodReturnType<A[M]> | undefined;
9
7
  error: Error | undefined;
10
8
  loading: boolean;
11
- field: {
12
- current: ReActorMethodField<A> | undefined;
13
- };
9
+ field: ReActorMethodField<A> | undefined;
14
10
  call: (replaceArgs?: ExtractReActorMethodArgs<A[M]> | undefined) => Promise<import("@ic-reactor/store").ExtractReActorMethodReturnType<A[M]> | undefined>;
15
11
  };
16
12
  useUpdateCall: <M_1 extends keyof A>(args: ReActorUseUpdateArgs<A, M_1>) => {
@@ -18,8 +14,6 @@ export declare const getCallHooks: <A extends unknown>(callMethod: CallMethod<A>
18
14
  error: Error | undefined;
19
15
  loading: boolean;
20
16
  call: (replaceArgs?: ExtractReActorMethodArgs<A[M_1]> | undefined) => Promise<import("@ic-reactor/store").ExtractReActorMethodReturnType<A[M_1]> | undefined>;
21
- field: {
22
- current: ReActorMethodField<A> | undefined;
23
- };
17
+ field: ReActorMethodField<A> | undefined;
24
18
  };
25
19
  };
package/dist/hooks.js CHANGED
@@ -36,7 +36,7 @@ const getCallHooks = (callMethod, actorStore) => {
36
36
  unsubscribe();
37
37
  };
38
38
  }, [functionName]);
39
- return { current: field };
39
+ return field;
40
40
  };
41
41
  const useReActorCall = ({ onError, onSuccess, onLoading, args = [], functionName, }) => {
42
42
  const [state, setState] = (0, react_1.useState)({
package/dist/index.d.ts CHANGED
@@ -2,9 +2,7 @@ import { AuthClientLoginOptions } from "@dfinity/auth-client";
2
2
  import type { ActorSubclass, ReActorAuthStore, ReActorOptions } from "@ic-reactor/store";
3
3
  export type ReActorContextType<A = ActorSubclass<any>> = ReActorAuthStore<A>;
4
4
  export declare const createReActor: <A extends unknown>(options: ReActorOptions) => {
5
- useField: (functionName: keyof A & string) => {
6
- current: import("@ic-reactor/store").ReActorMethodField<A> | undefined;
7
- };
5
+ useField: (functionName: keyof A & string) => import("@ic-reactor/store").ReActorMethodField<A> | undefined;
8
6
  useActorStore: () => {
9
7
  initialize: (agentOptions?: import("@dfinity/agent").HttpAgentOptions | undefined, identity?: import("@ic-reactor/store").Identity | undefined) => void;
10
8
  actor: A | null;
@@ -19,9 +17,7 @@ export declare const createReActor: <A extends unknown>(options: ReActorOptions)
19
17
  data: import("@ic-reactor/store").ExtractReActorMethodReturnType<A[M]> | undefined;
20
18
  error: Error | undefined;
21
19
  loading: boolean;
22
- field: {
23
- current: import("@ic-reactor/store").ReActorMethodField<A> | undefined;
24
- };
20
+ field: import("@ic-reactor/store").ReActorMethodField<A> | undefined;
25
21
  call: (replaceArgs?: import("@ic-reactor/store").ExtractReActorMethodArgs<A[M]> | undefined) => Promise<import("@ic-reactor/store").ExtractReActorMethodReturnType<A[M]> | undefined>;
26
22
  };
27
23
  useUpdateCall: <M_1 extends keyof A>(args: import("./types").ReActorUseUpdateArgs<A, M_1>) => {
@@ -29,9 +25,7 @@ export declare const createReActor: <A extends unknown>(options: ReActorOptions)
29
25
  error: Error | undefined;
30
26
  loading: boolean;
31
27
  call: (replaceArgs?: import("@ic-reactor/store").ExtractReActorMethodArgs<A[M_1]> | undefined) => Promise<import("@ic-reactor/store").ExtractReActorMethodReturnType<A[M_1]> | undefined>;
32
- field: {
33
- current: import("@ic-reactor/store").ReActorMethodField<A> | undefined;
34
- };
28
+ field: import("@ic-reactor/store").ReActorMethodField<A> | undefined;
35
29
  };
36
30
  useAuthClient: () => {
37
31
  authClient: import("@dfinity/auth-client").AuthClient | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/react",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "A React library for interacting with Dfinity actors",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -48,5 +48,5 @@
48
48
  "react": ">=16.8",
49
49
  "zustand": "4.4"
50
50
  },
51
- "gitHead": "97c96f8577f6cf748fca237932c3903638002d1e"
51
+ "gitHead": "c3ad75c896aca42961b08aa1c5d369abe221697d"
52
52
  }