createSwapUpdates
react-mosaic-component / createSwapUpdates
Function: createSwapUpdates()
createSwapUpdates<
T>(root,pathA,pathB):MosaicUpdate<T>[]
Defined in: libs/react-mosaic-component/src/lib/util/mosaicUpdates.ts:455
Creates the updates that make the nodes at pathA and pathB trade places.
Split percentages belong to positions, not nodes, so every pane keeps its
size and only the contents move. Swapping a node with itself is a no-op.
Type Parameters
T
T extends MosaicKey
Parameters
root
MosaicNode<T>
pathA
pathB
Returns
MosaicUpdate<T>[]