LogoRobo.js
Packages@robojs/sync

DragResult<T, ClientData>

Interface: DragResult<T, ClientData>

Result returned by useSyncDrag hook.

Type Parameters

Type ParameterDefault type
T extends DragState-
ClientDataunknown

Properties

PropertyTypeDescription
canInteractbooleanWhether current client can interact (not locked by others)
contextSyncContext<ClientData>Sync context for client awareness
dragHandlers{ onMouseDown: (e) => void; onTouchStart: (e) => void; }Handlers to spread onto draggable element
dragHandlers.onMouseDown(e: MouseEvent<Element, MouseEvent>) => void-
dragHandlers.onTouchStart(e: TouchEvent<Element>) => void-
isBeingDraggedbooleanWhether anyone is dragging (locked)
isDraggingbooleanWhether current client is dragging
lockundefined | LockContextLock context for advanced usage
setState(update: Partial<T> | (prev) => T) => voidUpdate state (partial or updater function)
stateTCurrent state (may be interpolated for remote updates)

On this page