Skip to content

Commit bf9de03

Browse files
Fixed the isAvailable example and doc
1 parent d831e1c commit bf9de03

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ export class MyHealthyClass {
5656
### `isAvailable`
5757
This function does not return a Promise; it resolves immediately, and tells you whether or not the device supports Health Data. On iOS this is probably always `true`. On Android the user will be prompted to (automatically) update their Play Services version in case it's not sufficiently up to date.
5858

59-
```typescript
60-
const isAvailable = this.healthData.isAvailable();
59+
```typescript
60+
this.healthData.isAvailable()
61+
.then(available => console.log(available));
6162
```
6263

6364
### `isAuthorized`
@@ -68,7 +69,7 @@ This function (and the next one) takes an `Array` of `HealthDataType`'s. Each of
6869

6970
```typescript
7071
this.healthData.isAuthorized([<HealthDataType>{name: "steps", accessType: "read"}])
71-
.then(authorized => console.log(authorized);
72+
.then(authorized => console.log(authorized));
7273
```
7374

7475
### `requestAuthorization`
@@ -85,7 +86,7 @@ const types: Array<HealthDataType> = [
8586
];
8687

8788
this.healthData.requestAuthorization(types)
88-
.then(authorized => console.log(authorized)
89+
.then(authorized => console.log(authorized))
8990
.catch(error => console.log("Request auth error: ", error));
9091
```
9192

demo-ng/app/app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export class AppComponent {
2525
}
2626

2727
isAvailable(): void {
28-
this.resultToShow = this.healthData.isAvailable() ? "Health Data available" : "Health Data not available :(";
28+
this.healthData.isAvailable()
29+
.then(available => this.resultToShow = available ? "Health Data available" : "Health Data not available :(");
2930
}
3031

3132
isAuthorized(): void {

src/health-data.common.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export interface QueryRequest {
2525
* Default "asc"
2626
*/
2727
sortOrder?: SortOrder;
28+
/**
29+
* Default undefined, so whatever the platform limit is.
30+
*/
31+
limit?: number;
2832
}
2933

3034
export interface ResponseItem {

0 commit comments

Comments
 (0)