Skip to content

Commit

Permalink
refactor(core): remove null as return type of data in useNodesData (#…
Browse files Browse the repository at this point in the history
…1575)

* refactor(core): remove `null` as return type of data

Signed-off-by: braks <[email protected]>

* chore(changeset): add

Signed-off-by: braks <[email protected]>

---------

Signed-off-by: braks <[email protected]>
  • Loading branch information
bcakmakoglu authored Aug 14, 2024
1 parent 876c198 commit 7aa49f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/real-pugs-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-flow/core": minor
---

Remove `null` as possible return type of data in `useNodesData`
6 changes: 3 additions & 3 deletions packages/core/src/composables/useNodesData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']>
}

/**
Expand Down Expand Up @@ -42,7 +42,7 @@ export function useNodesData(_nodeIds: any): any {
return {
id: node.id,
type: node.type,
data: node.data ?? null,
data: node.data,
}
}

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

0 comments on commit 7aa49f4

Please sign in to comment.