smsmslib 1.0.6 → 1.0.8

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.6",
3
+ "version": "1.0.8",
4
4
  "description": "Reusable functions for me.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -0,0 +1,17 @@
1
+ import { useMemo } from 'react';
2
+
3
+
4
+ export function sj_memo_use(f_cal, a_arg, a_dep)
5
+ {
6
+ function f_cal_caller()
7
+ {
8
+ const ret = f_cal(...a_arg);
9
+
10
+ return ret;
11
+ }
12
+
13
+ const ret_memo = useMemo(f_cal_caller, a_dep);
14
+
15
+ return ret_memo;
16
+ }
17
+
@@ -1,9 +1,9 @@
1
1
  import {useState} from "react";
2
2
 
3
3
 
4
- export function sj_state_use(init, hf_type, user)
4
+ export function sj_state_use(f_init, hf_type, user)
5
5
  {
6
- const [value, f_set] = useState(init);
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