UNPKG

reactopod

Version:

React Hooks for Typesaurus, type-safe Firestore ODM

7 lines (6 loc) 260 B
import { Collection } from 'typesaurus/collection' import { Doc } from 'typesaurus/doc' export default function useGet<Model>( collection: Collection<Model>, id: string | undefined ): typeof id extends undefined ? undefined : Doc<Model> | null | undefined