@ray-js/robot-data-stream 0.0.10-beta-7 → 0.0.10-beta-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/lib/index.js +2 -4
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import mitt from 'mitt';
|
|
|
4
4
|
import log4js from '@ray-js/log4js';
|
|
5
5
|
import { SweeperP2pInstance } from './api';
|
|
6
6
|
import sweeperP2pInstance from './api/sweeperP2p';
|
|
7
|
-
import { getSystemInfoSync } from '@ray-js/ray';
|
|
7
|
+
import { getSystemInfoSync, usePageEvent } from '@ray-js/ray';
|
|
8
8
|
const useP2PDataStream = (devId, onReceiveMapData, onReceivePathData, opt) => {
|
|
9
9
|
const {
|
|
10
10
|
logTag,
|
|
@@ -66,9 +66,7 @@ const useP2PDataStream = (devId, onReceiveMapData, onReceivePathData, opt) => {
|
|
|
66
66
|
ty.onAppHide(handleAppHide);
|
|
67
67
|
ty.onAppShow(handleAppShow);
|
|
68
68
|
}, []);
|
|
69
|
-
|
|
70
|
-
// 退出被拦截了,可以在此处理一些逻辑,如果允许退出则调用
|
|
71
|
-
// ty.exitMiniProgram 进行,否则当前小程序无法退出
|
|
69
|
+
usePageEvent('onUnload', () => {
|
|
72
70
|
unmount();
|
|
73
71
|
SweeperP2pInstance.deInitP2PSDK();
|
|
74
72
|
ty.offAppHide(handleAppHide);
|