react-native-update 8.3.0 → 8.4.0
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.web.js +1 -1
- package/lib/main.ts +1 -1
- package/lib/simpleUpdate.tsx +4 -4
- package/package.json +1 -1
package/lib/index.web.js
CHANGED
package/lib/main.ts
CHANGED
|
@@ -73,7 +73,7 @@ if (!uuid) {
|
|
|
73
73
|
const noop = () => {};
|
|
74
74
|
let reporter: UpdateEventsListener = noop;
|
|
75
75
|
|
|
76
|
-
export function
|
|
76
|
+
export function onPushyEvents(customReporter: UpdateEventsListener) {
|
|
77
77
|
reporter = customReporter;
|
|
78
78
|
if (isRolledBack) {
|
|
79
79
|
report({
|
package/lib/simpleUpdate.tsx
CHANGED
|
@@ -16,20 +16,20 @@ import {
|
|
|
16
16
|
switchVersionLater,
|
|
17
17
|
markSuccess,
|
|
18
18
|
downloadAndInstallApk,
|
|
19
|
-
|
|
19
|
+
onPushyEvents,
|
|
20
20
|
} from './main';
|
|
21
21
|
import { UpdateEventsListener } from './type';
|
|
22
22
|
|
|
23
23
|
export function simpleUpdate(
|
|
24
24
|
WrappedComponent: ComponentType,
|
|
25
|
-
options: { appKey?: string;
|
|
25
|
+
options: { appKey?: string; onPushyEvents?: UpdateEventsListener } = {},
|
|
26
26
|
) {
|
|
27
|
-
const { appKey,
|
|
27
|
+
const { appKey, onPushyEvents: eventListeners } = options;
|
|
28
28
|
if (!appKey) {
|
|
29
29
|
throw new Error('appKey is required for simpleUpdate()');
|
|
30
30
|
}
|
|
31
31
|
if (typeof eventListeners === 'function') {
|
|
32
|
-
|
|
32
|
+
onPushyEvents(eventListeners);
|
|
33
33
|
}
|
|
34
34
|
return __DEV__
|
|
35
35
|
? WrappedComponent
|