Skip to content

Commit 8f4d0f2

Browse files
committed
update readme to reflect rename of useHandle to useDocHandle
1 parent cff46f1 commit 8f4d0f2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

readme.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The `{repo}` option can be left out if you are using [RepoContext](#repocontext)
5151

5252
## createDocumentProjection
5353

54-
Get a fine-grained live view from a signal automerge handle.
54+
Get a fine-grained live view from a signal automerge `DocHandle`.
5555

5656
Underlying primitive for [`useDocument`](#usedocument-).
5757

@@ -89,25 +89,25 @@ const doc = makeDocumentProjection<{items: {title: string}[]}>(handle)
8989
return <h1>{doc.items[1].title}</h1>
9090
```
9191

92-
## useHandle
92+
## useDocHandle
9393

94-
Get a [handle](https://automerge.org/docs/repositories/dochandles/) from the
94+
Get a [DocHandle](https://automerge.org/docs/repositories/dochandles/) from the
9595
repo as a
9696
[resource](https://docs.solidjs.com/reference/basic-reactivity/create-resource).
9797

9898
Perfect for handing to `createDocumentProjection`.
9999

100100
```ts
101-
useHandle<T>(
101+
useDocHandle<T>(
102102
() => AnyDocumentId,
103103
options?: {repo: Repo}
104104
): Resource<Handle<T>>
105105
```
106106

107107
```tsx
108-
const handle = useHandle(id, {repo})
108+
const handle = useDocHandle(id, {repo})
109109
// or
110-
const handle = useHandle(id)
110+
const handle = useDocHandle(id)
111111
```
112112

113113
The `repo` option can be left out if you are using [RepoContext](#repocontext).
@@ -120,7 +120,7 @@ up in your app with `RepoContext`
120120
### `RepoContext`
121121

122122
A convenience context for Automerge-Repo Solid apps. Optional: if you prefer you
123-
can pass a repo as an option to `useHandle`.
123+
can pass a repo as an option to `useDocHandle` and `useDocument`.
124124

125125
```tsx
126126
<RepoContext.Provider repo={Repo}>

0 commit comments

Comments
 (0)