x-app-sdk 1.4.1 → 1.4.2
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/README.md +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -236,11 +236,13 @@ closeApp({ result: 'success', data: 'some data' });
|
|
|
236
236
|
#### `listenFocusEvent(callback)`
|
|
237
237
|
Lắng nghe sự kiện focus vào mini app.
|
|
238
238
|
```js
|
|
239
|
-
import { listenFocusEvent } from 'x-app-sdk';
|
|
239
|
+
import { fltSDK, listenFocusEvent } from 'x-app-sdk';
|
|
240
240
|
|
|
241
|
-
const
|
|
242
|
-
console.log(
|
|
243
|
-
}
|
|
241
|
+
const handelEVventFocus = (event: FlutterMessageResponse) => {
|
|
242
|
+
console.log("focus:", new Date())
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const unsubscribeFocus = listenFocusEvent(handelEVventFocus, fltSDK);
|
|
244
246
|
|
|
245
247
|
// Để hủy lắng nghe
|
|
246
248
|
unsubscribe();
|