get a fine-grained live view of a document, and its handle, from its url.
const [doc, handle] = useDocument<{count: number}>(() => props.url)const inc = () => handle()?.change(doc => doc.count++)return <button onClick={inc}>{doc.count}</button> Copy
const [doc, handle] = useDocument<{count: number}>(() => props.url)const inc = () => handle()?.change(doc => doc.count++)return <button onClick={inc}>{doc.count}</button>
a url (or a function that returns one)
Optional
[doc, handle]. doc is a * projection and handle is the useDocHandle memo
[doc, handle]
doc
handle
get a fine-grained live view of a document, and its handle, from its url.