mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-24 20:00:16 +08:00
docs(db-meter): refactored example
This commit is contained in:
parent
f11be24f74
commit
03c219936c
@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,7 +21,7 @@ import { Observable } from 'rxjs/Observable';
|
|||||||
*
|
*
|
||||||
* // Check if we are listening
|
* // Check if we are listening
|
||||||
* this.dbMeter.isListening().then(
|
* this.dbMeter.isListening().then(
|
||||||
* (isListening: boolean) => console.log(isListening)
|
* isListening => console.log(isListening)
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* // Stop listening
|
* // Stop listening
|
||||||
@ -43,7 +43,6 @@ import { Observable } from 'rxjs/Observable';
|
|||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DBMeter extends IonicNativePlugin {
|
export class DBMeter extends IonicNativePlugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts listening
|
* Starts listening
|
||||||
* @returns {Observable<any>} Returns an observable. Subscribe to start listening. Unsubscribe to stop listening.
|
* @returns {Observable<any>} Returns an observable. Subscribe to start listening. Unsubscribe to stop listening.
|
||||||
@ -52,27 +51,34 @@ export class DBMeter extends IonicNativePlugin {
|
|||||||
observable: true,
|
observable: true,
|
||||||
clearFunction: 'stop'
|
clearFunction: 'stop'
|
||||||
})
|
})
|
||||||
start(): Observable<any> { return; }
|
start(): Observable<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stops listening
|
* Stops listening
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
stop(): Promise<any> { return; }
|
stop(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the DB Meter is listening
|
* Check if the DB Meter is listening
|
||||||
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening
|
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean that tells us whether the DB meter is listening
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
isListening(): Promise<boolean> { return; }
|
isListening(): Promise<boolean> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the DB Meter instance
|
* Delete the DB Meter instance
|
||||||
* @returns {Promise<any>} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur.
|
* @returns {Promise<any>} Returns a promise that will resolve if the instance has been deleted, and rejects if errors occur.
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
delete(): Promise<any> { return; }
|
delete(): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user