applyChange(change) {
    // Check that the change's dependencies are met
    const lastSeq = this.byActor[change.actor] ? this.byActor[change.actor].length : 0
    if (change.seq !== lastSeq + 1) {
      throw new RangeError(`Expected sequence number ${lastSeq + 1}, got ${change.seq}`)
    }
    for (let [actor, dep] of Object.entries(change.deps || {})) {
      if (!this.byActor[actor] || this.byActor[actor].length < dep) {
        throw new RangeError(`Missing dependency: change ${dep} by actor ${actor}`)
      }
    }

    if (!this.byActor[change.actor]) this.byActor[change.actor] = []
    this.byActor[change.actor].push(change)

    change.ops.forEach((op, index) => {
      this.applyOp(Object.assign({opId: `${change.startOp + index}@${change.actor}`}, op))
    })
  }
Updates the document state by applying the change object `change`, in the format documented here:
https://github.com/automerge/automerge/blob/performance/BINARY_FORMAT.md#json-representation-of-changes