(button: number)
| 34 | private count: Record<number, number | undefined> = {} |
| 35 | |
| 36 | incOnClick(button: number) { |
| 37 | const current = |
| 38 | this.down[button] === undefined |
| 39 | ? undefined |
| 40 | : Number(this.down[button]) + 1 |
| 41 | |
| 42 | this.count = |
| 43 | this.count[button] === undefined |
| 44 | ? {} |
| 45 | : {[button]: Number(this.count[button]) + 1} |
| 46 | |
| 47 | return current |
| 48 | } |
| 49 | |
| 50 | getOnDown(button: number) { |
| 51 | this.down = {[button]: this.count[button] ?? 0} |