19 Matching Annotations
  1. Jan 2023
  2. Dec 2022
    1. ```js import React from "react"; import Dexie from "dexie"; import { useLiveQuery } from "dexie-react-hooks"; import { db } from "./db";

      // // React component // export function OldFriendsList() { const friends = useLiveQuery( () => db.friends .where('age') .above(75) .toArray() );

      if (!friends) return null; // Still loading.

      return

        { friends.map(friend =>
      • {friend.name}, {friend.age}
      • ) }
      ; } ```