smsmslib 1.0.11 → 1.0.13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smsmslib",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Reusable functions for me.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -4,15 +4,23 @@ import {useReducer} from "react";
4
4
  export function sj_reducer_use(hf_type, init, f_init, user)
5
5
  {
6
6
  const [value, f_dispatch] = useReducer(sj_reducer, init, f_init);
7
- const f_onAction = sj_reducer_onAction(hf_type, f_dispatch, user);
8
- const o_reducer = new Reducer_t(value, f_onAction, user);
7
+ const f_onAction = sj_reducer_onAction_use(hf_type, f_dispatch, user);
8
+ const o_reducer = Reducer_t_use(value, f_onAction, user);
9
9
 
10
- console.log("sj_reducer_use");
11
10
  return o_reducer;
12
11
  }
13
12
 
14
13
 
15
- function sj_reducer_onAction(hf_type, f_dispatch, user)
14
+ function sj_reducer_onAction_use(hf_type, f_dispatch, user)
15
+ {
16
+ const f_onAction = sj_memo_use(sj_reducer_onAction_create,
17
+ [hf_type, f_dispatch, user], [hf_type, user]);
18
+
19
+ return f_onAction;
20
+ }
21
+
22
+
23
+ function sj_reducer_onAction_create(hf_type, f_dispatch, user)
16
24
  {
17
25
  function onAction(o_event)
18
26
  {
@@ -44,10 +52,28 @@ function sj_reducer_onAction(hf_type, f_dispatch, user)
44
52
  function sj_reducer(value, o_action)
45
53
  {
46
54
  const o_next = o_action.f_type(value, o_action.o_event, o_action.user);
55
+
47
56
  return o_next;
48
57
  }
49
58
 
50
59
 
60
+ function Reducer_t_use(value, f_onAction, user)
61
+ {
62
+ const o_reducer = sj_memo_use(Reducer_t_create,
63
+ [value, f_onAction, user], [value, f_onAction, user]);
64
+
65
+ return o_reducer;
66
+ }
67
+
68
+
69
+ function Reducer_t_create(value, f_onAction, user)
70
+ {
71
+ const o_new = new Reducer_t(value, f_onAction, user);
72
+
73
+ return o_new;
74
+ }
75
+
76
+
51
77
  function Reducer_t(value, f_onAction, user)
52
78
  {
53
79
  this.value = value;
package/tags_JavaScript CHANGED
@@ -5,6 +5,8 @@
5
5
  !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
6
6
  !_TAG_PROGRAM_VERSION 5.9~svn20110310 //
7
7
  Reducer_t /home/sakae/work/react/smsmslib/system/usereducer.js ?^function Reducer_t(value, f_onAction, user)$?;" f
8
+ Reducer_t_create /home/sakae/work/react/smsmslib/system/usereducer.js ?^function Reducer_t_create(value, f_onAction, user)$?;" f
9
+ Reducer_t_use /home/sakae/work/react/smsmslib/system/usereducer.js ?^function Reducer_t_use(value, f_onAction, user)$?;" f
8
10
  State_t /home/sakae/work/react/smsmslib/system/usestate.js ?^function State_t(value, f_onAction, user)$?;" f
9
11
  f_cal_caller /home/sakae/work/react/smsmslib/system/usememo.js ?^ function f_cal_caller()$?;" f
10
12
  onAction /home/sakae/work/react/smsmslib/system/usereducer.js ?^ function onAction(o_event)$?;" f
@@ -12,7 +14,8 @@ onAction /home/sakae/work/react/smsmslib/system/usestate.js ?^ function onActio
12
14
  sj_loop_for_ms /home/sakae/work/react/smsmslib/system/util.js ?^export function sj_loop_for_ms(i_ms)$?;" f
13
15
  sj_memo_use /home/sakae/work/react/smsmslib/system/usememo.js ?^export function sj_memo_use(f_cal, a_arg, a_dep)$?;" f
14
16
  sj_reducer /home/sakae/work/react/smsmslib/system/usereducer.js ?^function sj_reducer(value, o_action)$?;" f
15
- sj_reducer_onAction /home/sakae/work/react/smsmslib/system/usereducer.js ?^function sj_reducer_onAction(hf_type, f_dispatch, user)$?;" f
17
+ sj_reducer_onAction_create /home/sakae/work/react/smsmslib/system/usereducer.js ?^function sj_reducer_onAction_create(hf_type, f_dispatch, user)$?;" f
18
+ sj_reducer_onAction_use /home/sakae/work/react/smsmslib/system/usereducer.js ?^function sj_reducer_onAction_use(hf_type, f_dispatch, user)$?;" f
16
19
  sj_reducer_use /home/sakae/work/react/smsmslib/system/usereducer.js ?^export function sj_reducer_use(hf_type, init, f_init, user)$?;" f
17
20
  sj_state_onAction /home/sakae/work/react/smsmslib/system/usestate.js ?^export function sj_state_onAction(value, f_set, hf_type, user)$?;" f
18
21
  sj_state_use /home/sakae/work/react/smsmslib/system/usestate.js ?^export function sj_state_use(f_init, hf_type, user)$?;" f