esoftplay 0.0.130-a → 0.0.130-c
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/bin/cli.js +2 -0
- package/bin/router.js +1 -19
- package/global.ts +2 -2
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -944,6 +944,8 @@ function help() {
|
|
|
944
944
|
"\n esp [options]",
|
|
945
945
|
"\n\n OPTIONS :",
|
|
946
946
|
"\n - help : panduan penggunaan",
|
|
947
|
+
"\n - a|analyze : untuk menambahkan view render counter di semua component",
|
|
948
|
+
"\n - ac|analyze clear : untuk menghapus view render counter di semua component",
|
|
947
949
|
"\n - u|update : untuk update esp module ke versi terakhir",
|
|
948
950
|
"\n - u|update all : untuk update semua esp module ke versi terakhir",
|
|
949
951
|
"\n - start : start esoftplay framework",
|
package/bin/router.js
CHANGED
|
@@ -435,7 +435,7 @@ declare module "esoftplay" {
|
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
interface useGlobalReturn<T> {
|
|
438
|
-
useState: () => [T, (newState: T) => void, () => T],
|
|
438
|
+
useState: () => [T, (newState: T | ((newState: T) => T)) => void, () => T],
|
|
439
439
|
get: (param?: string, ...params: string[]) => T,
|
|
440
440
|
set: (x: T | ((old: T) => T)) => void,
|
|
441
441
|
reset: () => void,
|
|
@@ -622,7 +622,6 @@ function createRouter() {
|
|
|
622
622
|
var nav = "";
|
|
623
623
|
var staticImport = []
|
|
624
624
|
|
|
625
|
-
// staticImport.push("var isEqual = require('react-fast-compare');\n")
|
|
626
625
|
staticImport.push("export function applyStyle(style){ return style };\n")
|
|
627
626
|
staticImport.push("export { default as useGlobalState } from '../../../node_modules/esoftplay/global';\n")
|
|
628
627
|
staticImport.push("export { default as usePersistState } from '../../../node_modules/esoftplay/persist';\n")
|
|
@@ -630,7 +629,6 @@ function createRouter() {
|
|
|
630
629
|
staticImport.push("export { default as useSafeState } from '../../../node_modules/esoftplay/state';\n")
|
|
631
630
|
staticImport.push("export { default as useLazyState } from '../../../node_modules/esoftplay/lazy';\n")
|
|
632
631
|
staticImport.push("export { default as esp } from '../../../node_modules/esoftplay/esp';\n")
|
|
633
|
-
// staticImport.push("export { default as createCache } from '../../../node_modules/esoftplay/_cache';\n")
|
|
634
632
|
staticImport.push("export { default as _global } from '../../../node_modules/esoftplay/_global';\n")
|
|
635
633
|
staticImport.push("import { stable } from 'usestable';\n")
|
|
636
634
|
|
|
@@ -681,22 +679,6 @@ function createRouter() {
|
|
|
681
679
|
});
|
|
682
680
|
}
|
|
683
681
|
}
|
|
684
|
-
|
|
685
|
-
// if (module == 'lib' && task == 'component') {
|
|
686
|
-
// staticImport.splice(2, 0, item)
|
|
687
|
-
// } else if (module == 'lib' && task == 'style') {
|
|
688
|
-
// staticImport.splice(4, 0, item)
|
|
689
|
-
// } else if (module == 'lib' && task == 'worker') {
|
|
690
|
-
// staticImport.splice(4, 0, item)
|
|
691
|
-
// } else if (module == 'lib' && task == 'navigation') {
|
|
692
|
-
// staticImport.splice(4, 0, item)
|
|
693
|
-
// } else if (task == 'style') {
|
|
694
|
-
// staticImport.splice(9, 0, item)
|
|
695
|
-
// } else if (task == 'scrollpicker') {
|
|
696
|
-
// staticImport.splice(10, 0, item)
|
|
697
|
-
// } else {
|
|
698
|
-
// staticImport.push(item);
|
|
699
|
-
// }
|
|
700
682
|
}
|
|
701
683
|
}
|
|
702
684
|
|
package/global.ts
CHANGED
|
@@ -7,7 +7,7 @@ const isEqual = require('react-fast-compare');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
export interface useGlobalReturn<T> {
|
|
10
|
-
useState: () => [T, (newState: T) => void, () => T],
|
|
10
|
+
useState: () => [T, (newState: T | ((newState: T) => T)) => void, () => T],
|
|
11
11
|
get: (param?: string, ...params: string[]) => T,
|
|
12
12
|
set: (x: T | ((old: T) => T)) => void,
|
|
13
13
|
reset: () => void,
|
|
@@ -175,7 +175,7 @@ export default function useGlobalState<T>(initValue: T, o?: useGlobalOption): us
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
|
|
178
|
-
function useState(): [T, (newState: T) => void, () => T] {
|
|
178
|
+
function useState(): [T, (newState: T | ((newState: T) => T)) => void, () => T] {
|
|
179
179
|
loadFromDisk()
|
|
180
180
|
|
|
181
181
|
let [l, s] = R.useState<T>(value);
|