Skip to content

Commit

Permalink
Merge ae2d625 into 5218767
Browse files Browse the repository at this point in the history
  • Loading branch information
alecgibson committed Jul 23, 2020
2 parents 5218767 + ae2d625 commit 493b969
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -400,6 +400,12 @@ Invokes the given callback function after

Note that `whenNothingPending` does NOT wait for pending `model.query()` calls.

`doc.pause()`
Prevents own ops being submitted to the server. If subscribed, remote ops will still be received.

`doc.resume()`
Resume sending own ops to the server if paused. Will flush the queued ops when called.

### Class: `ShareDB.Query`

`query.ready` _(Boolean)_
Expand Down
5 changes: 5 additions & 0 deletions lib/client/doc.js
Expand Up @@ -102,6 +102,11 @@ function Doc(connection, collection, id) {
// the time of op submit, so it may be toggled on before submitting a
// specifc op and toggled off afterward
this.preventCompose = false;

// Prevent own ops being submitted to the server. If subscribed, remote
// ops are still received. Should be toggled through the pause() and
// resume() methods to correctly flush on resume.
this.paused = false;
}
emitter.mixin(Doc);

Expand Down

0 comments on commit 493b969

Please sign in to comment.