refactor(inrernals): use one prop for all internals

This commit is contained in:
moklick
2022-05-26 20:20:35 +02:00
parent 732d92d10b
commit ee7084b5dc
9 changed files with 35 additions and 30 deletions
+5 -2
View File
@@ -1,7 +1,7 @@
import create from 'zustand';
import createContext from 'zustand/context';
import { clampPosition, getDimensions, handleBoundsSymbol } from '../utils';
import { clampPosition, getDimensions, internalsSymbol } from '../utils';
import { applyNodeChanges } from '../utils/changes';
import {
ReactFlowState,
@@ -60,7 +60,10 @@ const createStore = () =>
const handleBounds = getHandleBounds(update.nodeElement, transform[2]);
nodeInternals.set(node.id, {
...node,
[handleBoundsSymbol]: handleBounds,
[internalsSymbol]: {
...node[internalsSymbol],
handleBounds,
},
...dimensions,
});