@hello-pangea/dnd
Version:
Beautiful and accessible drag and drop for lists with React
17 lines (14 loc) • 336 B
text/typescript
import type {
State,
DraggingState,
CollectingState,
DropPendingState,
} from '../types';
export default function isDragging(
state: State,
): state is DraggingState | CollectingState | DropPendingState {
if (state.phase === 'IDLE' || state.phase === 'DROP_ANIMATING') {
return false;
}
return state.isDragging;
}