refactor(callbacks): dont provide noops as defaults, but make cbs optional

This commit is contained in:
moklick
2020-05-25 16:24:50 +02:00
parent 7324c79fd0
commit 17614bda6b
8 changed files with 118 additions and 78 deletions
+5 -4
View File
@@ -108,7 +108,8 @@ export interface NodeComponentProps {
yPos?: number;
targetPosition?: Position;
sourcePosition?: Position;
onClick?: (node: Node) => void | undefined;
onClick?: (node: Node) => void;
onNodeDragStart?: (node: Node) => void;
onNodeDragStop?: (node: Node) => void;
style?: CSSProperties;
}
@@ -122,9 +123,9 @@ export interface WrapNodeProps {
xPos: number;
yPos: number;
isInteractive: boolean;
onClick: (node: Node) => void | undefined;
onNodeDragStart: (node: Node) => void;
onNodeDragStop: (node: Node) => void;
onClick?: (node: Node) => void;
onNodeDragStart?: (node: Node) => void;
onNodeDragStop?: (node: Node) => void;
style?: CSSProperties;
sourcePosition?: Position;
targetPosition?: Position;