* Subscribe to loop iteration restarts on this controller. Returns an * unsubscribe function. Listeners fire synchronously inside `flushUpdate` * just before the next iteration is dispatched. * @internal
(fn: () => void)
| 264 | * @internal |
| 265 | */ |
| 266 | onLoopReset(fn: () => void): () => void { |
| 267 | const set = (this._onLoopReset ??= new Set()) |
| 268 | set.add(fn) |
| 269 | return () => { |
| 270 | set.delete(fn) |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | /** @internal Called at the end of every animation frame */ |
| 275 | protected _onFrame() { |