Module

React.DndKit.Helpers

Package
purescript-react-dnd-kit
Repository
i-am-the-slime/purescript-react-dnd-kit

#move Source

move :: Foreign -> Foreign -> Foreign

Reorder items based on a drag event. Works with flat arrays or grouped records. Use in onDragOver and onDragEnd handlers.

#swap Source

swap :: Foreign -> Foreign -> Foreign

Swap items based on a drag event. Works with flat arrays or grouped records.

#moveItems Source

moveItems :: forall items r. items -> { operation :: DragOperationSnapshot | r } -> items

Typed version of move for drag event handlers. Works with flat arrays or grouped records (e.g. kanban columns). Use in onDragOver or onDragEnd.

#swapItems Source

swapItems :: forall items r. items -> { operation :: DragOperationSnapshot | r } -> items

Typed version of swap for drag event handlers. Works with flat arrays or grouped records. Use in onDragOver or onDragEnd.

#arrayMove Source

arrayMove :: forall a. Array a -> Int -> Int -> Array a

Low-level array move: moves element from one index to another

#arraySwap Source

arraySwap :: forall a. Array a -> Int -> Int -> Array a

Low-level array swap: swaps elements at two indices