smsmslib 1.0.5 → 1.0.7
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/package.json +1 -1
- package/system/usestate.js +2 -2
- package/system/proto.js +0 -41
package/package.json
CHANGED
package/system/usestate.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {useState} from "react";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
export function sj_state_use(
|
|
4
|
+
export function sj_state_use(f_init, hf_type, user)
|
|
5
5
|
{
|
|
6
|
-
const [value, f_set] = useState(
|
|
6
|
+
const [value, f_set] = useState(f_init);
|
|
7
7
|
const f_onAction = sj_state_onAction(value, f_set, hf_type, user);
|
|
8
8
|
const o_state = new State_t(value, f_onAction, user);
|
|
9
9
|
|
package/system/proto.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import {useState} from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export function sj_use_state(ini)
|
|
5
|
-
{
|
|
6
|
-
const [val, f_set] = useState(ini);
|
|
7
|
-
const o_ret = new State_t(val, f_set);
|
|
8
|
-
|
|
9
|
-
return o_ret;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export function State_t(val, f_set)
|
|
14
|
-
{
|
|
15
|
-
this.val = val;
|
|
16
|
-
this.f_set = f_set;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export function sj_onAction_get(o_main)
|
|
21
|
-
{
|
|
22
|
-
function onAction(o_eve)
|
|
23
|
-
{
|
|
24
|
-
const o_update = o_main.o_update;
|
|
25
|
-
const s_type = o_eve.target.dataset.s_type;
|
|
26
|
-
|
|
27
|
-
if (s_type in o_update)
|
|
28
|
-
{
|
|
29
|
-
const ao_next = o_update[s_type](o_main, o_eve);
|
|
30
|
-
|
|
31
|
-
for (const o_next of ao_next)
|
|
32
|
-
{
|
|
33
|
-
o_next.f_set(o_next.val);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return onAction;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|