Skip to content

Commit

Permalink
update(types): Connection target and source as non-nullable strings
Browse files Browse the repository at this point in the history
* Required for a valid edge, so it should be required in a connection as well
  • Loading branch information
bcakmakoglu committed Apr 9, 2022
1 parent 2ce92b4 commit 6d86a77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package/src/composables/useHandle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const checkElementBelowIsValid = (
const result: Result = {
elementBelow,
isValid: false,
connection: { source: null, target: null, sourceHandle: null, targetHandle: null },
connection: { source: '', target: '', sourceHandle: null, targetHandle: null },
isHoveringHandle: false,
}

Expand Down Expand Up @@ -55,7 +55,7 @@ export const checkElementBelowIsValid = (
}

result.connection = connection
result.isValid = isValidConnection(connection)
result.isValid = isValidConnection(connection) || !result.connection.target || !result.connection.source
}
}

Expand Down
4 changes: 2 additions & 2 deletions package/src/types/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export enum ConnectionLineType {
/** Connection params that are passed when onConnect is called */
export interface Connection {
/** Source node id */
source: string | null
source: string
/** Target node id */
target: string | null
target: string
/** Source handle id */
sourceHandle: string | null
/** Target handle id */
Expand Down

0 comments on commit 6d86a77

Please sign in to comment.