share / sharedb-string-binding

Two-way bind json0 string operations to an HTML text input or textarea
MIT License
10 stars 9 forks source link

Is there any way to delay changes? #6

Open amilich opened 4 years ago

amilich commented 4 years ago

If I want my string binding to delay sending inserts/deletes on every single keyup, is there any way to delay events to condense multiple operations?

So, if I type "abcd," I see a single "si" operation to insert "abcd" instead of 4 separate inserts.

RisingGeek commented 4 years ago

This will require debounce @nateps . Am I correct?

nateps commented 4 years ago

The OT type can coalesce ops using compose, and it does this by default when the round trip time is slower than someone's typing speed. Would be a good feature request on https://github.com/share/sharedb to provide configuration for a throttle interval. Could be implemented as an option on the connection, document, or submitOp method.

RisingGeek commented 4 years ago

Okay, thanks