1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

chore: rename onPushyEvents

This commit is contained in:
sunnylqm 2023-10-28 18:28:23 +08:00
parent 23346a5f1d
commit d111bf5a9c
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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