docs icon indicating copy to clipboard operation
docs copied to clipboard

.changes() examples should include example outputs for includeState, includeInitial, includeOffsets

Open dalanmiller opened this issue 9 years ago • 3 comments

https://rethinkdb.com/api/javascript/changes/

Just discovered this and there should be some more examples as how to use this to properly maintain your own ordered data structure client-side (as well as other things)

dalanmiller avatar May 12 '16 22:05 dalanmiller

The last example shows example output for includeState and includeInitial. I think we could add one more example that uses includeOffsets (and maybe the others, if necessary) to maintain a data structure, as described above — is there some existing sample code for that?

chipotle avatar Sep 01 '16 20:09 chipotle

applyChange in horizon makes use of offsets. It's possible a simpler version of that would make a good example?

deontologician avatar Sep 01 '16 21:09 deontologician

The fundamental approach for maintaining an ordered list based on the offsets is also described in the first post here: https://github.com/rethinkdb/rethinkdb/issues/5334#issue-129627568

danielmewes avatar Sep 01 '16 21:09 danielmewes