* Returns a promise that resolves on the next requestFrame call. * Call this BEFORE triggering the state change that produces the frame.
()
| 127 | * Call this BEFORE triggering the state change that produces the frame. |
| 128 | */ |
| 129 | waitForFrame(): Promise<void> { |
| 130 | return new Promise<void>((resolve) => { |
| 131 | this.frameResolvers.push(resolve); |
| 132 | }); |
| 133 | } |
| 134 | |
| 135 | pollEvents(): Promise<BackendEventBatch> { |
| 136 | if (this.stopped) { |