mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
Update README.md
Incorrect usage of watchPosition().subscribe and then unsubscribe
This commit is contained in:
parent
97ad1bc92f
commit
3a2c8f3e26
@ -23,8 +23,7 @@ Geolocation.getCurrentPosition().then(pos => {
|
|||||||
console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
|
console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
|
||||||
});
|
});
|
||||||
|
|
||||||
let watch = Geolocation.watchPosition();
|
let watch = Geolocation.watchPosition().subscribe(pos => {
|
||||||
watch.subscribe(pos => {
|
|
||||||
console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
|
console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user