(o)
| 6 | } |
| 7 | |
| 8 | export function observe(o) { |
| 9 | if (observer) { |
| 10 | throw new Error('Multiple observers not implemented.'); |
| 11 | } |
| 12 | |
| 13 | observer = o; |
| 14 | emitChange(); |
| 15 | |
| 16 | return () => { |
| 17 | observer = null; |
| 18 | }; |
| 19 | } |
| 20 | |
| 21 | export function canMoveKnight(toX, toY) { |
| 22 | const [x, y] = knightPosition; |
no test coverage detected