MCPcopy Create free account
hub / github.com/react-dnd/react-dnd / observe

Function observe

examples/00 Chessboard/Tutorial App/Game.js:8–19  ·  view source on GitHub ↗
(o)

Source from the content-addressed store, hash-verified

6}
7
8export 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
21export function canMoveKnight(toX, toY) {
22 const [x, y] = knightPosition;

Callers 1

constructorFunction · 0.90

Calls 1

emitChangeFunction · 0.85

Tested by

no test coverage detected