1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 12:11:39 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
sunnylqm
2023-10-28 18:30:28 +08:00
parent 5784f2f046
commit 41af560a39
4 changed files with 7 additions and 7 deletions

View File

@@ -15,4 +15,4 @@ export const downloadAndInstallApk = noop;
export const setCustomEndpoints = noop;
export const getCurrentVersionInfo = noop;
export const simpleUpdate = (app) => app;
export const onEvents = noop;
export const onPushyEvents = noop;

View File

@@ -73,7 +73,7 @@ if (!uuid) {
const noop = () => {};
let reporter: UpdateEventsListener = noop;
export function onEvents(customReporter: UpdateEventsListener) {
export function onPushyEvents(customReporter: UpdateEventsListener) {
reporter = customReporter;
if (isRolledBack) {
report({

View File

@@ -16,20 +16,20 @@ import {
switchVersionLater,
markSuccess,
downloadAndInstallApk,
onEvents,
onPushyEvents,
} from './main';
import { UpdateEventsListener } from './type';
export function simpleUpdate(
WrappedComponent: ComponentType,
options: { appKey?: string; onEvents?: UpdateEventsListener } = {},
options: { appKey?: string; onPushyEvents?: UpdateEventsListener } = {},
) {
const { appKey, onEvents: eventListeners } = options;
const { appKey, onPushyEvents: eventListeners } = options;
if (!appKey) {
throw new Error('appKey is required for simpleUpdate()');
}
if (typeof eventListeners === 'function') {
onEvents(eventListeners);
onPushyEvents(eventListeners);
}
return __DEV__
? WrappedComponent

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-update",
"version": "8.3.0",
"version": "8.4.0",
"description": "react-native hot update",
"main": "lib/index.ts",
"scripts": {