@ldhop/react
v0.0.1-alpha.16
Published
Follow your nose through linked data resources - for React
Downloads
34
Maintainers
Readme
@ldhop/react
Follow your nose through linked data resources with React
Installation
Install the package
yarn add @ldhop/react
# or
npm install --save @ldhop/react
Install peer dependencies
yarn add react @tanstack/react-query
# or
npm install --save react @tanstack/react-query
Usage
Learn how to write a LDhop query
import { useLDhopQuery } from '@ldhop/react'
const query: RdfQuery = [
// ... the query
]
const { isLoading, variables, quads } = useLDhopQuery({
query, // LDhop query
variables: useMemo(() => ({ person: [webId] }), [webId]), // starting points (memoized)
fetch, // default or custom fetch, perhaps authenticated
})