chore: rename onPushyEvents
This commit is contained in:
parent
23346a5f1d
commit
d111bf5a9c
@ -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;
|
||||
|
@ -78,7 +78,7 @@ if (!uuid) {
|
||||
const noop = () => {};
|
||||
let reporter: UpdateEventsListener = noop;
|
||||
|
||||
export function onEvents(customReporter: UpdateEventsListener) {
|
||||
export function onPushyEvents(customReporter: UpdateEventsListener) {
|
||||
reporter = customReporter;
|
||||
if (isRolledBack) {
|
||||
report({
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user