()
| 149 | } |
| 150 | |
| 151 | const dispose = () => { |
| 152 | if (isDisposed) return |
| 153 | // Flush any pending updates before disposing to prevent data loss |
| 154 | flush() |
| 155 | isDisposed = true |
| 156 | if (intervalId !== null) { |
| 157 | clearInterval(intervalId) |
| 158 | intervalId = null |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | // Start the periodic flush interval |
| 163 | intervalId = setInterval(flush, flushIntervalMs) |
no test coverage detected