Register a frame subscriber. Returns an unsubscribe handle.
(handler: (f: AnyFrame) => void)
| 111 | |
| 112 | /** Register a frame subscriber. Returns an unsubscribe handle. */ |
| 113 | onFrame(handler: (f: AnyFrame) => void): () => void { |
| 114 | this._subscribers.add(handler); |
| 115 | return () => { |
| 116 | this._subscribers.delete(handler); |
| 117 | }; |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * Wait for the next frame matching `predicate`. Drains queued frames first; |