diff --git a/src/plugins/batterystatus.ts b/src/plugins/batterystatus.ts index 1a0dc28de..ea739af4e 100644 --- a/src/plugins/batterystatus.ts +++ b/src/plugins/batterystatus.ts @@ -2,7 +2,7 @@ import {Plugin} from './plugin'; import {Observable} from "rxjs/Observable"; /** - * + * @name Battery Status * * Requires Cordova plugin: cordova-plugin-batterystatus. For more info, please see the [BatteryStatus plugin docs](https://github.com/apache/cordova-plugin-battery-status). * @@ -12,13 +12,16 @@ import {Observable} from "rxjs/Observable"; * * @usage * ```js - * - * BatteryStatus.onChange().subscribe( + * // watch change in battery status + * let subscription = BatteryStatus.onChange().subscribe( * status => { - * + * console.log(status); * } * ); * + * // stop watch + * subscription.unsubscribe(); + * * ``` */ @Plugin({ @@ -27,7 +30,7 @@ import {Observable} from "rxjs/Observable"; export class BatteryStatus { /** - * Watches the change in battery level + * Watch the change in battery level * @returns {Observable} Returns an observable that pushes the new battery level */ static onChange () : Observable { @@ -38,4 +41,4 @@ export class BatteryStatus { }); } -} +} \ No newline at end of file