@kingstinct/react-native-healthkit
Version:
React Native bindings for HealthKit
16 lines (12 loc) • 409 B
text/typescript
import { CategoryTypes } from '../modules'
import type { CategoryTypeIdentifier } from '../types/CategoryTypeIdentifier'
export async function getMostRecentCategorySample<
T extends CategoryTypeIdentifier,
>(identifier: T) {
const samples = await CategoryTypes.queryCategorySamples(identifier, {
limit: 1,
ascending: false,
})
return samples[0]
}
export default getMostRecentCategorySample