phecda-react 0.1.0-beta.16 → 0.1.0-beta.18

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.js CHANGED
@@ -42,8 +42,14 @@ function useO(model) {
42
42
  }
43
43
  const tag = (0, import_phecda_web.getTag)(model);
44
44
  if (tag in state) {
45
- if (origin.get(state[tag]) !== model)
46
- console.warn(`Synonym module: Module taged "${String(tag)}" has been loaded before, so won't load Module "${model.name}"`);
45
+ if (process.env.NODE_ENV === "development") {
46
+ if (origin.get(state[tag]) === model)
47
+ return state[tag];
48
+ } else {
49
+ if (origin.get(state[tag]) !== model)
50
+ console.warn(`Synonym model: Module taged "${String(tag)}" has been loaded before, so won't load Module "${model.name}"`);
51
+ return state[tag];
52
+ }
47
53
  return state[tag];
48
54
  }
49
55
  const instance = new model();
package/dist/index.mjs CHANGED
@@ -13,8 +13,14 @@ function useO(model) {
13
13
  }
14
14
  const tag = getTag(model);
15
15
  if (tag in state) {
16
- if (origin.get(state[tag]) !== model)
17
- console.warn(`Synonym module: Module taged "${String(tag)}" has been loaded before, so won't load Module "${model.name}"`);
16
+ if (process.env.NODE_ENV === "development") {
17
+ if (origin.get(state[tag]) === model)
18
+ return state[tag];
19
+ } else {
20
+ if (origin.get(state[tag]) !== model)
21
+ console.warn(`Synonym model: Module taged "${String(tag)}" has been loaded before, so won't load Module "${model.name}"`);
22
+ return state[tag];
23
+ }
18
24
  return state[tag];
19
25
  }
20
26
  const instance = new model();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-react",
3
- "version": "0.1.0-beta.16",
3
+ "version": "0.1.0-beta.18",
4
4
  "description": "provide phecda function to react by valtio",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -14,7 +14,7 @@
14
14
  "dependencies": {
15
15
  "react": "^18.2.0",
16
16
  "valtio": "^1.13.0",
17
- "phecda-web": "1.0.1-beta.12"
17
+ "phecda-web": "1.0.1-beta.13"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/react": "^18.2.48",