Skip to content

Commit

Permalink
feat(background-mode): replace event listeners with on method
Browse files Browse the repository at this point in the history
The methods onactivate, ondeactive and onfailure no longer exist. You must now use `on` method.
  • Loading branch information
ihadeed committed Mar 2, 2017
1 parent 5144345 commit ffdbab7
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions src/plugins/backgroundmode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

}

0 comments on commit ffdbab7

Please sign in to comment.