Replies: 1 comment
-
If you're using the Although if you're just trying to do a confirmation before deleting, you can use the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi folks
I noticed in the docs that the function
onNodesChange
has thechanges
argument of typeNodeChange[]
, andNodeChange
is a union type of selection, deletion, add, dimension etc.I've also noticed that when I've made selection and deletion changes on the flow, the
changes
array is always an array of one particular type (select, dimensions, delete etc)I now need to filter for particular changes in order to display different results i.e. a modal display if the user is certain they'd like to delete a node. But when the above came to my attention I wondered... do I need to filter the changes array if I know that the changes array has values of the same type? Can I just check the first element and say, ok, it's all select / delete, perform this action?
Hopefully this makes sense. I'm pretty certain from my basic knowledge of event listeners this will be the case, but wanted to double check. If this is the case, I'd like to change the docs type description to reflect this.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions