({ value: _value, diff })
| 47 | } |
| 48 | |
| 49 | #process({ value: _value, diff }) { |
| 50 | // Count value starts as a NaN |
| 51 | const value = JSON.stringify(_value); |
| 52 | const count = this.#state.has(value) ? (this.#state.get(value) + diff) : diff; |
| 53 | |
| 54 | if (count <= 0) { |
| 55 | this.#state.delete(value); |
| 56 | } else { |
| 57 | this.#state.set(value, count); |
| 58 | } |
| 59 | |
| 60 | |
| 61 | if (this.#history) { |
| 62 | this.#history.push({ value: _value, diff }); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | update(updates, timestamp) { |
| 67 | if (updates.length > 0) { |
nothing calls this directly
no outgoing calls
no test coverage detected