esoftplay 0.0.136-v → 0.0.136-x
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/router.js +3 -4
- package/modules/lib/navigation.ts +10 -1
- package/package.json +1 -1
package/bin/router.js
CHANGED
|
@@ -169,6 +169,7 @@ function createIndex() {
|
|
|
169
169
|
importer.push(`import useSafeState from 'esoftplay/state'`)
|
|
170
170
|
importer.push(`import useLazyState from 'esoftplay/lazy'`)
|
|
171
171
|
importer.push(`import Storage from 'esoftplay/storage'`)
|
|
172
|
+
importer.push(`import FastStorage from 'esoftplay/mmkv'`)
|
|
172
173
|
importer.push(`import { createDebounce, createInterval, createTimeout, useDebounce, useInterval, useTimeout } from 'esoftplay/timeout'`)
|
|
173
174
|
AllRoutes.forEach((nav) => {
|
|
174
175
|
const [module, task] = nav.split('/')
|
|
@@ -281,11 +282,9 @@ export * as ${ucword(module) + ucword(task) + SuffixHooksProperty} from '../../.
|
|
|
281
282
|
}
|
|
282
283
|
if (HookModules.includes(nav)) {
|
|
283
284
|
item += "" +
|
|
284
|
-
"import
|
|
285
|
-
"const _" + ucword(module) + ucword(task) + " = React.lazy(() => import('../../../../." + Modules[module][task] + "')); \n" +
|
|
285
|
+
"import _" + ucword(module) + ucword(task) + " from '../../../../." + Modules[module][task] + "'; \n" +
|
|
286
286
|
"import * as " + ucword(module) + ucword(task) + SuffixHooksProperty + " from '../../../../." + Modules[module][task] + "';\n" +
|
|
287
|
-
"const
|
|
288
|
-
"const " + ucword(module) + ucword(task) + " = stable(UpdatedComponent(_" + ucword(module) + ucword(task) + ")); \n" +
|
|
287
|
+
"const " + ucword(module) + ucword(task) + " = stable(_" + ucword(module) + ucword(task) + "); \n" +
|
|
289
288
|
"export { " + ucword(module) + ucword(task) + SuffixHooksProperty + ", " + ucword(module) + ucword(task) + " };\n"
|
|
290
289
|
} else if (UseLibs.includes(nav)) {
|
|
291
290
|
item += "" +
|
|
@@ -7,7 +7,7 @@ import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
|
7
7
|
import { UserRoutes } from 'esoftplay/cache/user/routes/import';
|
|
8
8
|
|
|
9
9
|
import esp from 'esoftplay/esp';
|
|
10
|
-
import React from "react";
|
|
10
|
+
import React, { useEffect } from "react";
|
|
11
11
|
|
|
12
12
|
export interface LibNavigationInjector {
|
|
13
13
|
args: any,
|
|
@@ -67,6 +67,15 @@ export default {
|
|
|
67
67
|
navigate<S extends keyof EspArgsInterface>(route: S, params?: EspArgsInterface[S]): void {
|
|
68
68
|
this._ref?.navigate?.(route, params)
|
|
69
69
|
},
|
|
70
|
+
useBackResult(props: any): (res: any) => void {
|
|
71
|
+
const key = this.getResultKey(props)
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
return () => this.cancelBackResult(key)
|
|
75
|
+
}, [])
|
|
76
|
+
|
|
77
|
+
return (res: any) => this.sendBackResult(res, key)
|
|
78
|
+
},
|
|
70
79
|
getResultKey(props: any): number {
|
|
71
80
|
return this.getArgs(props, "_senderKey", 0)
|
|
72
81
|
},
|