@ic-reactor/core 0.1.2 → 0.2.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 +3 -7
- package/dist/index.js +2 -6
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ActorSubclass, ReActorAuthStore } from "@ic-reactor/store";
|
|
1
|
+
import type { ActorSubclass, ReActorAuthStore, ReActorOptions } from "@ic-reactor/store";
|
|
3
2
|
import { ReActorQuery, ReActorUpdate } from "./types";
|
|
4
3
|
export type ReActorContextType<A = ActorSubclass<any>> = ReActorAuthStore<A>;
|
|
5
|
-
export
|
|
6
|
-
initializeOnMount?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const createReActor: <A extends unknown>(actorInitializer: (agent: HttpAgent) => A, options?: CreateReActorOptions) => {
|
|
4
|
+
export declare const createReActor: <A extends unknown>(options: ReActorOptions) => {
|
|
9
5
|
unsubscribe: () => void;
|
|
10
|
-
initialize: (agentOptions?: HttpAgentOptions | undefined, identity?: import("@
|
|
6
|
+
initialize: (agentOptions?: import("@dfinity/agent").HttpAgentOptions | undefined, identity?: import("@ic-reactor/store").Identity | undefined) => void;
|
|
11
7
|
authenticate: () => Promise<void>;
|
|
12
8
|
actorStore: import("@ic-reactor/store").ReActorActorStore<A>;
|
|
13
9
|
authStore: ReActorAuthStore<A>;
|
package/dist/index.js
CHANGED
|
@@ -22,12 +22,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.createReActor = void 0;
|
|
24
24
|
const store_1 = require("@ic-reactor/store");
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
const createReActor = (actorInitializer, options = {}) => {
|
|
29
|
-
const optionsWithDefaults = Object.assign(Object.assign({}, defaultCreateReActorOptions), options);
|
|
30
|
-
const _a = (0, store_1.createReActorStore)((agent) => actorInitializer(agent), optionsWithDefaults), { callMethod, actorStore, authStore } = _a, rest = __rest(_a, ["callMethod", "actorStore", "authStore"]);
|
|
25
|
+
const createReActor = (options) => {
|
|
26
|
+
const _a = (0, store_1.createReActorStore)(options), { callMethod, actorStore, authStore } = _a, rest = __rest(_a, ["callMethod", "actorStore", "authStore"]);
|
|
31
27
|
const updateMethodState = (method, args = [], newState) => {
|
|
32
28
|
const hash = (0, store_1.generateRequestHash)(args);
|
|
33
29
|
actorStore.setState((state) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ic-reactor/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"@dfinity/candid": "0.20",
|
|
41
41
|
"@dfinity/identity": "^0.20",
|
|
42
42
|
"@dfinity/principal": "^0.20",
|
|
43
|
-
"@ic-reactor/store": "^0.
|
|
43
|
+
"@ic-reactor/store": "^0.2.0",
|
|
44
44
|
"zustand": "4.4"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@peculiar/webcrypto": "1.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "8499f295b9e20d1dc12bd4f0a33927bfce54c23a"
|
|
50
50
|
}
|