@expressive/react 0.24.1 → 0.25.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/lib/index.esm.js +4 -5
- package/lib/index.js +4 -5
- package/package.json +6 -4
package/lib/index.esm.js
CHANGED
|
@@ -41,17 +41,16 @@ const Applied = new WeakMap();
|
|
|
41
41
|
Control.use = (adapter) => {
|
|
42
42
|
const state = useState(0);
|
|
43
43
|
const hook = useMemo(() => adapter(state[1]), []);
|
|
44
|
-
const
|
|
45
|
-
const applied = Applied.get(instance);
|
|
44
|
+
const applied = Applied.get(hook.instance);
|
|
46
45
|
if (applied)
|
|
47
46
|
useLookup();
|
|
48
47
|
else if (applied === undefined) {
|
|
49
|
-
const pending = Pending.get(instance);
|
|
48
|
+
const pending = Pending.get(hook.instance);
|
|
50
49
|
if (pending) {
|
|
51
50
|
const local = useLookup();
|
|
52
51
|
pending.forEach(init => init(local));
|
|
53
|
-
Applied.set(instance, local);
|
|
54
|
-
Pending.delete(instance);
|
|
52
|
+
Applied.set(hook.instance, local);
|
|
53
|
+
Pending.delete(hook.instance);
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
useLayoutEffect(hook.mount, []);
|
package/lib/index.js
CHANGED
|
@@ -43,17 +43,16 @@ const Applied = new WeakMap();
|
|
|
43
43
|
mvc.Control.use = (adapter) => {
|
|
44
44
|
const state = react.useState(0);
|
|
45
45
|
const hook = react.useMemo(() => adapter(state[1]), []);
|
|
46
|
-
const
|
|
47
|
-
const applied = Applied.get(instance);
|
|
46
|
+
const applied = Applied.get(hook.instance);
|
|
48
47
|
if (applied)
|
|
49
48
|
useLookup();
|
|
50
49
|
else if (applied === undefined) {
|
|
51
|
-
const pending = Pending.get(instance);
|
|
50
|
+
const pending = Pending.get(hook.instance);
|
|
52
51
|
if (pending) {
|
|
53
52
|
const local = useLookup();
|
|
54
53
|
pending.forEach(init => init(local));
|
|
55
|
-
Applied.set(instance, local);
|
|
56
|
-
Pending.delete(instance);
|
|
54
|
+
Applied.set(hook.instance, local);
|
|
55
|
+
Pending.delete(hook.instance);
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
react.useLayoutEffect(hook.mount, []);
|
package/package.json
CHANGED
|
@@ -24,10 +24,12 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "rollup --config",
|
|
26
26
|
"watch": "jest --watchAll",
|
|
27
|
-
"test": "jest --collectCoverage"
|
|
27
|
+
"test": "jest --collectCoverage",
|
|
28
|
+
"prebuild": "rm -rf lib/",
|
|
29
|
+
"preversion": "npm run test && npm run build"
|
|
28
30
|
},
|
|
29
31
|
"dependencies": {
|
|
30
|
-
"@expressive/mvc": "^0.
|
|
32
|
+
"@expressive/mvc": "^0.25.0"
|
|
31
33
|
},
|
|
32
34
|
"peerDependencies": {
|
|
33
35
|
"react": ">=16.8.0 <19.0.0"
|
|
@@ -39,6 +41,6 @@
|
|
|
39
41
|
"react": ">=17.0.2",
|
|
40
42
|
"react-test-renderer": "^17.0.2"
|
|
41
43
|
},
|
|
42
|
-
"version": "0.
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"version": "0.25.0",
|
|
45
|
+
"gitHead": "a7c707bf59325bd4bf1388e061f7991acb726a13"
|
|
44
46
|
}
|