MCPcopy
hub / github.com/stackblitz/alien-signals / unlink

Function unlink

src/system.ts:93–116  ·  view source on GitHub ↗
(link: Link, sub = link.sub)

Source from the content-addressed store, hash-verified

91 }
92
93 function unlink(link: Link, sub = link.sub): Link | undefined {
94 const { dep, prevDep, nextDep, nextSub, prevSub } = link;
95 if (nextDep !== undefined) {
96 nextDep.prevDep = prevDep;
97 } else {
98 sub.depsTail = prevDep;
99 }
100 if (prevDep !== undefined) {
101 prevDep.nextDep = nextDep;
102 } else {
103 sub.deps = nextDep;
104 }
105 if (nextSub !== undefined) {
106 nextSub.prevSub = prevSub;
107 } else {
108 dep.subsTail = prevSub;
109 }
110 if (prevSub !== undefined) {
111 prevSub.nextSub = nextSub;
112 } else if ((dep.subs = nextSub) === undefined) {
113 unwatched(dep);
114 }
115 return nextDep;
116 }
117
118 function propagate(link: Link, innerWrite: boolean): void {
119 let next = link.nextSub;

Callers 6

triggerFunction · 0.85
updateComputedFunction · 0.85
runFunction · 0.85
effectScopeOperFunction · 0.85
disposeAllDepsInReverseFunction · 0.85
purgeDepsFunction · 0.85

Calls 1

unwatchedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…