Skip to content

Commit 2e73240

Browse files
authored
collab guides (#27)
1 parent f14a1c2 commit 2e73240

5 files changed

Lines changed: 643 additions & 1 deletion

File tree

packages/demo/src/editor/Editor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export function Editor({ doc }: Props) {
102102
const presenceConfig = useMemo<PresenceClientConfig>(
103103
() => ({
104104
userId,
105+
// Todo: Remove clientId from this path. It is not used
105106
sendIndicator: async (clientId, indicator) => {
106107
await fetch(`/api/docs/${doc.id}/presence/${clientId}`, {
107108
method: "POST",

packages/demo/src/server.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ const collabAuthority = new CollabAuthority<Transaction<DB>>(
6666
getCommit: async (tr, docId, commitRef) => {
6767
return (await getCommitByRef(tr, docId, commitRef)) ?? null;
6868
},
69+
// Todo: make the role of this function more clear to external users. getCommitsAfter
70+
// could work
6971
getCommits: async (tr, docId, version) => {
7072
return await getCommitsAfter(tr, docId, version);
7173
},

0 commit comments

Comments
 (0)