You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To use the component, you expose the API in a file in your `convex/` folder, and
100
-
use the editor-specific sync React hook, passing in a reference to
101
-
the API you defined. For this example, we'll create the API in
102
-
`convex/example.ts`.
103
+
use the editor-specific sync React hook, passing in a reference to the API you
104
+
defined. For this example, we'll create the API in `convex/example.ts`.
103
105
104
106
```ts
105
107
// convex/example.ts
@@ -194,21 +196,22 @@ See a working example in [example.ts](./example/convex/example.ts) and
194
196
195
197
### Configuring the snapshot debounce interval
196
198
197
-
The snapshot debounce interval is set to one second by default.
198
-
You can specify a different interval with the `snapshotDebounceMs` option when
199
-
calling `useTiptapSync` or `useBlockNoteSync`.
199
+
The snapshot debounce interval is set to one second by default. You can specify
200
+
a different interval with the `snapshotDebounceMs` option when calling
201
+
`useTiptapSync` or `useBlockNoteSync`.
200
202
201
203
A snapshot won't be sent until both of these are true:
202
204
203
205
- The document has been idle for the debounce interval.
204
206
- The current user was the last to make a change.
205
207
206
-
There can be races, but since each client will submit the snapshot for their
207
-
own change, they won't conflict with each other and are safe to apply.
208
+
There can be races, but since each client will submit the snapshot for their own
209
+
change, they won't conflict with each other and are safe to apply.
208
210
209
211
### Creating a new document
210
212
211
-
You can create a new document from the client by calling `sync.create(content)`, or on the server by calling `prosemirrorSync.create(ctx, id, content)`.
213
+
You can create a new document from the client by calling `sync.create(content)`,
214
+
or on the server by calling `prosemirrorSync.create(ctx, id, content)`.
212
215
213
216
The content should be a JSON object matching the
214
217
[Schema](https://tiptap.dev/docs/editor/core-concepts/schema). If you're using
@@ -229,8 +232,8 @@ For client-side document creation:
229
232
230
233
### Transforming the document server-side
231
234
232
-
You can transform the document server-side. It will give you the latest
233
-
version of the document, and you return a
235
+
You can transform the document server-side. It will give you the latest version
0 commit comments