fix(application): restore AndroidApplication.on etc. (#10336)

This commit is contained in:
Igor Randjelovic
2023-07-10 09:45:12 +02:00
committed by GitHub
parent 5359153a11
commit 08049340b5

View File

@ -126,6 +126,28 @@ export class ApplicationCommon {
readonly loadAppCssEvent = 'loadAppCss';
readonly cssChangedEvent = 'cssChanged';
// Expose statically for backwards compat on AndroidApplication.on etc.
/**
* @deprecated Use `Application.android.on()` instead.
*/
static on: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents);
/**
* @deprecated Use `Application.android.once()` instead.
*/
static once: ApplicationEvents['on'] = globalEvents.once.bind(globalEvents);
/**
* @deprecated Use `Application.android.off()` instead.
*/
static off: ApplicationEvents['off'] = globalEvents.off.bind(globalEvents);
/**
* @deprecated Use `Application.android.notify()` instead.
*/
static notify: ApplicationEvents['notify'] = globalEvents.notify.bind(globalEvents);
/**
* @deprecated Use `Application.android.hasListeners()` instead.
*/
static hasListeners: ApplicationEvents['hasListeners'] = globalEvents.hasListeners.bind(globalEvents);
// Application events go through the global events.
on: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents);
once: ApplicationEvents['on'] = globalEvents.once.bind(globalEvents);