(fn: () => void)
| 210 | } |
| 211 | |
| 212 | export function trigger(fn: () => void) { |
| 213 | const sub: ReactiveNode = { |
| 214 | deps: undefined, |
| 215 | depsTail: undefined, |
| 216 | flags: ReactiveFlags.Watching, |
| 217 | }; |
| 218 | const prevSub = setActiveSub(sub); |
| 219 | try { |
| 220 | fn(); |
| 221 | } finally { |
| 222 | activeSub = prevSub; |
| 223 | sub.flags = ReactiveFlags.None; |
| 224 | let link = sub.deps; |
| 225 | while (link !== undefined) { |
| 226 | const dep = link.dep; |
| 227 | link = unlink(link, sub); |
| 228 | const subs = dep.subs; |
| 229 | if (subs !== undefined) { |
| 230 | propagate(subs, !!runDepth); |
| 231 | shallowPropagate(subs); |
| 232 | } |
| 233 | } |
| 234 | if (!batchDepth) { |
| 235 | flush(); |
| 236 | } |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | function updateComputed(c: ComputedNode): boolean { |
| 241 | if (c.flags & HasChildEffect) { |
no test coverage detected
searching dependent graphs…