| 13 | const arrow = (x) => legacyHelper(x, 1); |
| 14 | |
| 15 | class Widget extends EventEmitter { |
| 16 | static registry = new Map(); |
| 17 | #privateField = 1; |
| 18 | label = 'w'; |
| 19 | onTick = () => { |
| 20 | this.render(); |
| 21 | }; |
| 22 | wrapped = debounce(function () { |
| 23 | expensive(); |
| 24 | }, 50); |
| 25 | |
| 26 | constructor(opts) { |
| 27 | super(); |
| 28 | this.opts = opts; |
| 29 | register(this.onTick); |
| 30 | } |
| 31 | |
| 32 | render() { |
| 33 | paint(this.label); |
| 34 | } |
| 35 | |
| 36 | static create(opts) { |
| 37 | return new Widget(opts); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | // AMD-style wrapper — anonymous, but inner functions must still surface. |
| 42 | (function () { |