remove redundant connectionLookup entries
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
$: if (onconnect || ondisconnect) {
|
||||
// connectionLookup is not reactive, so we use edges to get notified about updates
|
||||
$edges;
|
||||
connections = $connectionLookup.get(`${nodeId}-${type}-${id || null}`);
|
||||
connections = $connectionLookup.get(`${nodeId}-${type}${id ? `-${id}` : ''}`);
|
||||
}
|
||||
|
||||
$: {
|
||||
|
||||
@@ -22,7 +22,7 @@ const initialConnections: HandleConnection[] = [];
|
||||
* @param param.id - the handle id (this is only needed if the node has multiple handles of the same type)
|
||||
* @returns an array with connections
|
||||
*/
|
||||
export function useHandleConnections({ type, nodeId, id = null }: useHandleConnectionsParams) {
|
||||
export function useHandleConnections({ type, nodeId, id }: useHandleConnectionsParams) {
|
||||
const { edges, connectionLookup } = useStore();
|
||||
|
||||
console.warn(
|
||||
@@ -37,7 +37,7 @@ export function useHandleConnections({ type, nodeId, id = null }: useHandleConne
|
||||
return derived(
|
||||
[edges, connectionLookup],
|
||||
([, connectionLookup], set) => {
|
||||
const nextConnections = connectionLookup.get(`${currentNodeId}-${type}-${id || null}`);
|
||||
const nextConnections = connectionLookup.get(`${currentNodeId}-${type}${id ? `-${id}` : ''}`);
|
||||
|
||||
if (!areConnectionMapsEqual(nextConnections, prevConnections)) {
|
||||
prevConnections = nextConnections;
|
||||
|
||||
Reference in New Issue
Block a user