Skip to content

Commit

Permalink
Update DEVELOPER.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tlancina committed Mar 11, 2016
1 parent 99ddbe3 commit ce133d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ Let's take a look at `getCurrentPosition` first.
static getCurrentPosition(options?: GeolocationOptions): Promise<Geoposition> { return }
```

It's just a stub. The `return` is only there to keep the TypeScript type-checker from complaining since we indicate the `getCurrentPosition` returns a `Promise<Geoposition>`.
It's just a stub. The `return` is only there to keep the TypeScript type-checker from complaining since we indicate that `getCurrentPosition` returns a `Promise<Geoposition>`.

By default, the `@Cordova` decorator wraps the plugin callbacks in a Promise that resolves when the success callback is called and rejects when the error callback is called. It also ensures that Cordova and the underlying plugin are available, and prints helpful diagnostics if they aren't.

You'll also notice that it is a static method. That's because the plugin class is just a utility class to call the underlying Cordova plugin methods, it's not an instance and has no state.
You'll also notice that `getCurrentPosition` is a static method. That's because the plugin class is just a utility class to call the underlying Cordova plugin methods, it's not an instance and has no state.

Next, let's look at the `watchPosition` method.

Expand Down

0 comments on commit ce133d1

Please sign in to comment.