esoftplay 0.0.136-v → 0.0.136-w

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 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('/')
@@ -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
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.136-v",
3
+ "version": "0.0.136-w",
4
4
  "description": "embedding data from esoftplay framework (web based) into mobile app",
5
5
  "main": "cache/index.js",
6
6
  "types": "../../index.d.ts",