diff --git a/src/core-manager/replication-state.js b/src/core-manager/replication-state.js index 5a249a79..534b91c4 100644 --- a/src/core-manager/replication-state.js +++ b/src/core-manager/replication-state.js @@ -6,10 +6,14 @@ import { throttle } from 'throttle-debounce' export class ReplicationState extends TypedEmitter { /** @type {Map} */ #coreStates = new Map() + #handleUpdate - #handleUpdate = throttle(200, function () { - this.emit('state', this.getState()) - }).bind(this) + constructor({ throttleMs = 200 } = {}) { + super() + this.#handleUpdate = throttle(throttleMs, function () { + this.emit('state', this.getState()) + }).bind(this) + } getState() { const state = {