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

Function parseRoleFromHandlerId

packages/dnd-core/src/HandlerRegistry.js:50–59  ·  view source on GitHub ↗
(handlerId)

Source from the content-addressed store, hash-verified

48}
49
50function parseRoleFromHandlerId(handlerId) {
51 switch (handlerId[0]) {
52 case 'S':
53 return HandlerRoles.SOURCE;
54 case 'T':
55 return HandlerRoles.TARGET;
56 default:
57 invariant(false, `Cannot parse handler ID: ${handlerId}`);
58 }
59}
60
61export default class HandlerRegistry {
62 constructor(store) {

Callers 2

isSourceIdMethod · 0.85
isTargetIdMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected