mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 10:36:14 +08:00
feat(background-mode): replace event listeners with on method
The methods onactivate, ondeactive and onfailure no longer exist. You must now use `on` method.
This commit is contained in:
parent
5144345c9e
commit
ffdbab7b26
@ -113,24 +113,15 @@ export class BackgroundMode {
|
||||
static configure(options?: BackgroundModeConfiguration): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Called when background mode is activated.
|
||||
* @returns {Observable<any>} returns an observable that emits when background mode is activated
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static onactivate(): Observable<any> { return; };
|
||||
|
||||
/**
|
||||
* Called when background mode is deactivated.
|
||||
* @returns {Observable<any>} returns an observable that emits when background mode is deactivated
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static ondeactivate(): Observable<any> { return; };
|
||||
|
||||
/**
|
||||
* Called when background mode fails
|
||||
* @returns {Observable<any>} returns an observable that emits when background mode fails
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
static onfailure(): Observable<any> { return; };
|
||||
* Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
|
||||
* @param event {string} Event name
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
clearFunction: 'un',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static on(event: string): Observable<any> { return; }
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user