Skip to content

Commit b848a61

Browse files
krisnyeclaude
andcommitted
fix(data-lit): propagate {} | null constraint to useDragTransaction type param
withFilter gained U extends {} | null in #127; useDragTransaction's unconstrained T no longer satisfies it. Constraining T here aligns the type throughout the call chain and reflects the genuine semantic — a transaction arg of undefined makes no sense. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f3a343d commit b848a61

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/data-lit/src/hooks/use-drag-transaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { useEffect } from "./use-effect.js";
55
import type { AsyncArgsProvider } from '@adobe/data/ecs';
66
import { Observe } from '@adobe/data/observe';
77

8-
export type DragTransactionProps<T> = DragObserveProps & {
8+
export type DragTransactionProps<T extends {} | null> = DragObserveProps & {
99
transaction: (asyncArgs: AsyncArgsProvider<T>) => void;
1010
update: (drag: DragMove | DragEnd) => T | void;
1111
};
1212

13-
export function useDragTransaction<T>(props: DragTransactionProps<T>, dependencies: unknown[]) {
13+
export function useDragTransaction<T extends {} | null>(props: DragTransactionProps<T>, dependencies: unknown[]) {
1414
const { transaction, update } = props;
1515
const dragObserve = useDragObserve(props, dependencies);
1616
const startDragTransaction = () => {

0 commit comments

Comments
 (0)