MCPcopy Create free account
hub / github.com/effector/effector / clearNode

Function clearNode

src/effector/clearNode.ts:93–113  ·  view source on GitHub ↗
(
  graphite: NodeUnit,
  {
    deep,
  }: {
    deep?: boolean
  } = {},
)

Source from the content-addressed store, hash-verified

91}
92const clearMap = (map: Map<any, any> | Set<any>) => map.clear()
93export 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}

Callers 15

clearNode.test.tsFile · 0.90
domain.test.tsFile · 0.90
useUnitBaseFunction · 0.90
createWatchFunction · 0.90
offFunction · 0.90
createSubscriptionFunction · 0.90
region.test.tsFile · 0.90
applyFunction · 0.90
clearNode.test.tsFile · 0.90
domain.test.tsFile · 0.90
beforeDestroyFunction · 0.90
beforeUnmountFunction · 0.90

Calls 4

getGraphFunction · 0.90
clearMapFunction · 0.85
clearNodeNormalizedFunction · 0.85
domainMethod · 0.80

Tested by 3

applyFunction · 0.72
nameClashCheckFunction · 0.72
nameClashCheckFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…