fix dep chain
This commit is contained in:
@@ -34,6 +34,24 @@ export const RenderingNode = memo(function RenderingNode({ id }: Props) {
|
||||
const yamlText = srcNode && srcNode.type === 'config' ? srcNode?.data?.yaml ?? '' : ''
|
||||
const srcData = srcNode?.data ?? {}
|
||||
|
||||
const configSignature = useMemo(
|
||||
() =>
|
||||
nodes
|
||||
.filter((n: any) => n.type === 'config')
|
||||
.map((n: any) => `${n.id}:${n.data?.title ?? ''}:${n.data?.yaml ?? ''}`)
|
||||
.join('|'),
|
||||
[nodes]
|
||||
)
|
||||
|
||||
const edgesSignature = useMemo(
|
||||
() =>
|
||||
edges
|
||||
.map((e: any) => `${e.source}->${e.target}`)
|
||||
.sort()
|
||||
.join('|'),
|
||||
[edges]
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
// debug
|
||||
// eslint-disable-next-line no-console
|
||||
@@ -104,7 +122,7 @@ export const RenderingNode = memo(function RenderingNode({ id }: Props) {
|
||||
setOutput('')
|
||||
setError({ kind: 'parse', message: msg })
|
||||
}
|
||||
}, [id, incomingIds.join(','), yamlText, nodes.length, edges.length])
|
||||
}, [id, incomingIds.join(','), yamlText, configSignature, edgesSignature])
|
||||
|
||||
return (
|
||||
<BaseNode className="w-96">
|
||||
|
||||
Reference in New Issue
Block a user