refactor(core): remove null as return type of data in useNodesData (#1575)
* refactor(core): remove `null` as return type of data Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
5
.changeset/real-pugs-guess.md
Normal file
5
.changeset/real-pugs-guess.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@vue-flow/core": minor
|
||||
---
|
||||
|
||||
Remove `null` as possible return type of data in `useNodesData`
|
||||
@@ -7,7 +7,7 @@ import { useVueFlow } from './useVueFlow'
|
||||
interface NodeData<NodeType extends Node = GraphNode> {
|
||||
id: string
|
||||
type: NodeType['type']
|
||||
data: NonNullable<NodeType['data']> | null
|
||||
data: NonNullable<NodeType['data']>
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,7 @@ export function useNodesData(_nodeIds: any): any {
|
||||
return {
|
||||
id: node.id,
|
||||
type: node.type,
|
||||
data: node.data ?? null,
|
||||
data: node.data,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export function useNodesData(_nodeIds: any): any {
|
||||
data.push({
|
||||
id: node.id,
|
||||
type: node.type,
|
||||
data: node.data ?? null,
|
||||
data: node.data,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user