📄️ useLiveQuery
useLiveQuery is a React hook that provides access to live query results, enabling real-time updates in your app. For a step-by-step tutorial building an app with useLiveQuery, check out the React tutorial.
📄️ useDocument
You can also subscribe directly to database updates, and automatically redraw when necessary. When sync is enabled you'll have both parties updating the same database in real-time. Here's an example of a simple shared text area (in real life you'd probably want to use an operational transform library like Yjs or Automerge for shared text areas, which both work great with Fireproof).
📄️ Database Config
Most applications will only need the useLiveQuery or useDocument hooks, which use the default configuration. But if you need to do custom database setup, or configure a database name other than the React hook default ("useFireproof") you can call the useFireproof hook directly. This is also useful if you want to distribute the Fireproof React hooks through your app with a React Context.