@hello-pangea/dnd
Version:
Beautiful and accessible drag and drop for lists with React
8 lines (7 loc) • 323 B
text/typescript
import type { State, StateWhenUpdatesAllowed } from '../types';
// Using function declaration as arrow function does not play well with the %checks syntax
export default function isMovementAllowed(
state: State,
): state is StateWhenUpdatesAllowed {
return state.phase === 'DRAGGING' || state.phase === 'COLLECTING';
}