Skip to content

Commit

Permalink
Fix README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mphill authored and robertherber committed Dec 1, 2024
1 parent e3def49 commit 442ef18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ Some imperative examples:
### HealthKit Anchors (breaking change in 6.0)
In 6.0 you can use HealthKit anchors to get changes and deleted items which is very useful for syncing. This is a breaking change - but a very easy one to handle that TypeScript should help you with. Most queries now return an object containing samples which is what was returned as only an array before. In addition you also get deletedSamples and a newAnchor you can use for more advanced use cases, example:
```TypeScript
const { newAnchor, samples, deletedSamples } = await queryQuantitySamples(HKQuantityTypeIdentifier.stepCount, {
const { newAnchor, samples, deletedSamples } = await queryQuantitySamplesWithAnchor(HKQuantityTypeIdentifier.stepCount, {
limit: 2,
})

const nextResult = await queryQuantitySamples(HKQuantityTypeIdentifier.stepCount, {
const nextResult = await queryQuantitySamplesWithAnchor(HKQuantityTypeIdentifier.stepCount, {
limit: 2,
anchor: newAnchor,
})
Expand Down

0 comments on commit 442ef18

Please sign in to comment.