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

Function validateSourceContract

packages/dnd-core/src/HandlerRegistry.js:12–16  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

10};
11
12function validateSourceContract(source) {
13 invariant(typeof source.canDrag === 'function', 'Expected canDrag to be a function.');
14 invariant(typeof source.beginDrag === 'function', 'Expected beginDrag to be a function.');
15 invariant(typeof source.endDrag === 'function', 'Expected endDrag to be a function.');
16}
17
18function validateTargetContract(target) {
19 invariant(typeof target.canDrop === 'function', 'Expected canDrop to be a function.');

Callers 1

addSourceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected