Skip to content

Commit

Permalink
Pass onFirstRender option to ySyncPlugin
Browse files Browse the repository at this point in the history
here is an option called `onFirstRender` in the `CollaborationOptions` type; however, it is not used anywhere. This commit passes the option to the Yjs' sync plugin.
  • Loading branch information
furkan3ayraktar committed Oct 12, 2023
1 parent 42039c0 commit 0c4bff5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/extension-collaboration/src/collaboration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ export const Collaboration = Extension.create<CollaborationOptions>({
}
}

return [ySyncPlugin(fragment), yUndoPluginInstance]
const onFirstRender = this.options.onFirstRender
const ySyncPluginOptions = onFirstRender ? { onFirstRender } : {}
const ySyncPluginInstance = ySyncPlugin(fragment, ySyncPluginOptions)

return [ySyncPluginInstance, yUndoPluginInstance]
},
})

0 comments on commit 0c4bff5

Please sign in to comment.