phecda-react 1.0.3 → 1.0.4

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.mts CHANGED
@@ -4,7 +4,7 @@ export * from 'phecda-web';
4
4
 
5
5
  declare const PhecdaContext: react.Context<WebPhecda | undefined>;
6
6
  declare const phecdaSymbol: unique symbol;
7
- declare function createPhecda(): WebPhecda;
7
+ declare function createPhecda(models?: Construct[]): WebPhecda;
8
8
 
9
9
  declare function usePhecda(): WebPhecda;
10
10
  declare function getPhecda(phecda?: WebPhecda): WebPhecda;
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export * from 'phecda-web';
4
4
 
5
5
  declare const PhecdaContext: react.Context<WebPhecda | undefined>;
6
6
  declare const phecdaSymbol: unique symbol;
7
- declare function createPhecda(): WebPhecda;
7
+ declare function createPhecda(models?: Construct[]): WebPhecda;
8
8
 
9
9
  declare function usePhecda(): WebPhecda;
10
10
  declare function getPhecda(phecda?: WebPhecda): WebPhecda;
package/dist/index.js CHANGED
@@ -39,10 +39,12 @@ var import_phecda_web = require("phecda-web");
39
39
  var import_react = require("react");
40
40
  var PhecdaContext = (0, import_react.createContext)(void 0);
41
41
  var phecdaSymbol = Symbol("");
42
- function createPhecda() {
43
- return new import_phecda_web.WebPhecda("react", (instance) => {
42
+ function createPhecda(models) {
43
+ const phecda = new import_phecda_web.WebPhecda("react", (instance) => {
44
44
  return (0, import_valtio.proxy)(instance);
45
45
  });
46
+ models?.forEach((model) => phecda.init(model));
47
+ return phecda;
46
48
  }
47
49
  __name(createPhecda, "createPhecda");
48
50
 
package/dist/index.mjs CHANGED
@@ -7,10 +7,12 @@ import { WebPhecda } from "phecda-web";
7
7
  import { createContext } from "react";
8
8
  var PhecdaContext = createContext(void 0);
9
9
  var phecdaSymbol = Symbol("");
10
- function createPhecda() {
11
- return new WebPhecda("react", (instance) => {
10
+ function createPhecda(models) {
11
+ const phecda = new WebPhecda("react", (instance) => {
12
12
  return proxy(instance);
13
13
  });
14
+ models?.forEach((model) => phecda.init(model));
15
+ return phecda;
14
16
  }
15
17
  __name(createPhecda, "createPhecda");
16
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-react",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "provide phecda function to react by valtio",
5
5
  "author": "fgsreally",
6
6
  "license": "MIT",
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "react": "^18.2.0",
20
20
  "valtio": "^1.13.0",
21
- "phecda-web": "2.0.4"
21
+ "phecda-web": "2.0.5"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/react": "^18.2.48",