mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +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; }
|
static configure(options?: BackgroundModeConfiguration): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when background mode is activated.
|
* Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
|
||||||
* @returns {Observable<any>} returns an observable that emits when background mode is activated
|
* @param event {string} Event name
|
||||||
*/
|
* @returns {Observable<any>}
|
||||||
@CordovaFunctionOverride()
|
*/
|
||||||
static onactivate(): Observable<any> { return; };
|
@Cordova({
|
||||||
|
observable: true,
|
||||||
/**
|
clearFunction: 'un',
|
||||||
* Called when background mode is deactivated.
|
clearWithArgs: true
|
||||||
* @returns {Observable<any>} returns an observable that emits when background mode is deactivated
|
})
|
||||||
*/
|
static on(event: string): Observable<any> { return; }
|
||||||
@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; };
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user