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:
Ibby 2017-03-01 22:03:23 -05:00
parent 5144345c9e
commit ffdbab7b26

View File

@ -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
* Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`.
* @param event {string} Event name
* @returns {Observable<any>}
*/
@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; };
@Cordova({
observable: true,
clearFunction: 'un',
clearWithArgs: true
})
static on(event: string): Observable<any> { return; }
}