tripledoc-react
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

tripledoc-react

Utilities to make it easier to work with Tripledoc in React applications.

Installation

npm install tripledoc-react plandoc solid-auth-client

Usage

import { describeDocument, fetchDocument } from 'plandoc';
import { useDocument } from 'tripledoc-react';

const virtualProfileDoc = describeDocument().isFoundAt('https://www.w3.org/People/Berners-Lee/card');

const SomeComponent = () => {
  const [profileDoc, setProfileDoc] = useDocument(virtualProfileDoc);

  if (typeof profileDoc === 'undefined') {
    return <>Loading…</>;
  }
  if (profileDoc === null) {
    return <>Error: Could not fetch profile information.</>
  }

  // Do something with `profileDoc`
};

Changelog

See CHANGELOG.

License

MIT © Inrupt

/tripledoc-react/

    Package Sidebar

    Install

    npm i tripledoc-react

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    28.1 kB

    Total Files

    33

    Last publish

    Collaborators

    • vincenttunru