(fn: () => void)
| 189 | } |
| 190 | |
| 191 | export function effectScope(fn: () => void): () => void { |
| 192 | const e: EffectScopeNode = { |
| 193 | deps: undefined, |
| 194 | depsTail: undefined, |
| 195 | subs: undefined, |
| 196 | subsTail: undefined, |
| 197 | flags: ReactiveFlags.Mutable, |
| 198 | }; |
| 199 | const prevSub = setActiveSub(e); |
| 200 | if (prevSub !== undefined) { |
| 201 | link(e, prevSub, 0); |
| 202 | prevSub.flags |= HasChildEffect; |
| 203 | } |
| 204 | try { |
| 205 | fn(); |
| 206 | } finally { |
| 207 | activeSub = prevSub; |
| 208 | } |
| 209 | return effectScopeOper.bind(e); |
| 210 | } |
| 211 | |
| 212 | export function trigger(fn: () => void) { |
| 213 | const sub: ReactiveNode = { |
searching dependent graphs…