From 1d772af4a4c6424af570672372025617bebbc686 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:59:02 +0200 Subject: [PATCH] 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> --- .changeset/real-pugs-guess.md | 5 +++++ packages/core/src/composables/useNodesData.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/real-pugs-guess.md diff --git a/.changeset/real-pugs-guess.md b/.changeset/real-pugs-guess.md new file mode 100644 index 00000000..dce23e89 --- /dev/null +++ b/.changeset/real-pugs-guess.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": minor +--- + +Remove `null` as possible return type of data in `useNodesData` diff --git a/packages/core/src/composables/useNodesData.ts b/packages/core/src/composables/useNodesData.ts index 9c1e8ca2..337beb1a 100644 --- a/packages/core/src/composables/useNodesData.ts +++ b/packages/core/src/composables/useNodesData.ts @@ -7,7 +7,7 @@ import { useVueFlow } from './useVueFlow' interface NodeData { id: string type: NodeType['type'] - data: NonNullable | null + data: NonNullable } /** @@ -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, }) } }