(
graphite: NodeUnit,
{
deep,
}: {
deep?: boolean
} = {},
)
| 91 | } |
| 92 | const clearMap = (map: Map<any, any> | Set<any>) => map.clear() |
| 93 | export const clearNode = ( |
| 94 | graphite: NodeUnit, |
| 95 | { |
| 96 | deep, |
| 97 | }: { |
| 98 | deep?: boolean |
| 99 | } = {}, |
| 100 | ) => { |
| 101 | let isDomainUnit = false |
| 102 | //@ts-expect-error |
| 103 | if (graphite.ownerSet) graphite.ownerSet.delete(graphite) |
| 104 | if (is.domain(graphite)) { |
| 105 | isDomainUnit = true |
| 106 | const history = graphite.history |
| 107 | clearMap(history.events) |
| 108 | clearMap(history.effects) |
| 109 | clearMap(history.stores) |
| 110 | clearMap(history.domains) |
| 111 | } |
| 112 | clearNodeNormalized(getGraph(graphite), !!deep, isDomainUnit, null, false) |
| 113 | } |
searching dependent graphs…