(defcomp
  ()
  (~docs/page
    :title "Resource + Suspense Pattern"
    (p
      (code "resource")
      " wraps an async operation into a signal with "
      (code "loading")
      "/"
      (code "data")
      "/"
      (code "error")
      " states. Combined with "
      (code "cond")
      " + "
      (code "deref")
      ", this is the suspense pattern — no special form needed.")
    (~reactive-islands/index/demo-resource)
    (~docs/code
      :src (highlight
        (component-source "~reactive-islands/index/demo-resource")
        "lisp"))
    (p
      "React equivalent: "
      (code "Suspense")
      " + "
      (code "use()")
      " or "
      (code "useSWR")
      ". SX doesn't need a special "
      (code "suspense")
      " form because "
      (code "resource")
      " returns a signal and "
      (code "cond")
      " + "
      (code "deref")
      " creates reactive conditional rendering. When the promise resolves, the signal updates and the "
      (code "cond")
      " branch switches automatically.")))
