smsmslib 1.0.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.
Files changed (2) hide show
  1. package/package.json +21 -0
  2. package/system/proto.js +41 -0
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "smsmslib",
3
+ "version": "1.0.0",
4
+ "description": "Reusable functions for me.",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/szoo2022/work.git"
11
+ },
12
+ "keywords": [
13
+ "smsmslib"
14
+ ],
15
+ "author": "",
16
+ "license": "ISC",
17
+ "bugs": {
18
+ "url": "https://github.com/szoo2022/work/issues"
19
+ },
20
+ "homepage": "https://github.com/szoo2022/work#readme"
21
+ }
@@ -0,0 +1,41 @@
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_tar_cls = o_eve.target.className;
26
+
27
+ if (s_tar_cls in o_update)
28
+ {
29
+ const ao_next = o_update[s_tar_cls](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
+