-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collaborative text field using react with debounce #614
Comments
I have to say we used to debounce, but we actually stopped because it's a much smoother collaboration experience without the debounce (since edits arrive at remote users' editors as fast as possible). If you don't need to go back to previous documents, you can TTL your ops collection. |
I believe ShareDB debounces based on network latency already, internally, so no need to worry about manually batching. |
This would be awesome to have as a new example in the Also JFYI, if you use |
First of all thanks for this awesome package!
I wanted to create a collaborative text field. The closest one I could find was the textarea example located in
/examples/textarea
and is using a third party package calledsharedb-string-binding
. However it is using plain html with javascript, so by looking at the code I tried to recreate it using react (but could be done using angular/vue/svelte).feel free to comment at any part of my implementation as I would like to make a PR to provide an example using any of the modern front-end frameworks. However the main issue is if it is possible to add a debounce in order to significantly reduce the number of operations that are submitted. Both in my implementation and in the provided textarea example, a new operation is submitted on every keypress meaning that a new document is created in the history collection. Imagine we have an application with many collaborators and many collaborative fields. The history will become enormous quite fast. A debouncer will significantly reduce the size of the history collection but even with a debouncer in place is there a recommended way of handling the history?
Thanks.
The text was updated successfully, but these errors were encountered: