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:
Braks
2024-08-14 13:59:02 +02:00
parent 2976b11025
commit 1d772af4a4
2 changed files with 8 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
---
"@vue-flow/core": minor
---
Remove `null` as possible return type of data in `useNodesData`

View File

@@ -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,
})
}
}