@freelog/tools-lib 0.1.151 → 0.1.153
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/dist/i18n/I18nNext.d.ts +1 -1
- package/dist/service-API/collections.d.ts +1 -0
- package/dist/service-API/operation.d.ts +1 -0
- package/dist/service-API/resources.d.ts +21 -4
- package/dist/service-API/storages.d.ts +1 -1
- package/dist/tools-lib.cjs.development.js +110 -51
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +110 -51
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/hooks.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/linkTo.d.ts +10 -0
- package/dist/utils/regexp.d.ts +2 -0
- package/package.json +4 -2
- package/src/i18n/I18nNext.ts +155 -155
- package/src/service-API/collections.ts +1 -3
- package/src/service-API/nodes.ts +81 -81
- package/src/service-API/operation.ts +1 -0
- package/src/service-API/presentables.ts +292 -292
- package/src/service-API/recombinations/index.ts +97 -97
- package/src/service-API/resources.ts +30 -4
- package/src/service-API/storages.ts +362 -361
- package/src/utils/hooks.ts +17 -0
- package/src/utils/index.ts +22 -20
- package/src/utils/linkTo.ts +439 -413
- package/src/utils/regexp.ts +12 -5
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
export function useGetState<T>(initVal: T): [T, (newVal: T) => void, () => T] {
|
|
4
|
+
const [state, setState] = React.useState<T>(initVal);
|
|
5
|
+
const ref = React.useRef<T>(initVal);
|
|
6
|
+
|
|
7
|
+
function setStateCopy(newVal: T): void {
|
|
8
|
+
ref.current = newVal;
|
|
9
|
+
setState(newVal);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function getState(): T {
|
|
13
|
+
return ref.current;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return [state, setStateCopy, getState];
|
|
17
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import * as Format from './format';
|
|
2
|
-
import * as Regexp from './regexp';
|
|
3
|
-
import * as LinkTo from './linkTo';
|
|
4
|
-
import * as Predefined from './predefined';
|
|
5
|
-
import Axios, {request} from './axios';
|
|
6
|
-
import * as Tool from './tools';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import * as Format from './format';
|
|
2
|
+
import * as Regexp from './regexp';
|
|
3
|
+
import * as LinkTo from './linkTo';
|
|
4
|
+
import * as Predefined from './predefined';
|
|
5
|
+
import Axios, {request} from './axios';
|
|
6
|
+
import * as Tool from './tools';
|
|
7
|
+
import * as Hook from './hooks';
|
|
8
|
+
// import I18n from '../i18n';
|
|
9
|
+
|
|
10
|
+
const FUtil = {
|
|
11
|
+
Format,
|
|
12
|
+
Regexp,
|
|
13
|
+
LinkTo,
|
|
14
|
+
Predefined,
|
|
15
|
+
Axios,
|
|
16
|
+
Request: request,
|
|
17
|
+
Tool,
|
|
18
|
+
Hook,
|
|
19
|
+
// i18n: new I18n(),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default FUtil;
|