( view: LView, notifier: ChangeDetectionScheduler, fn: (onCleanup: EffectCleanupRegisterFn) => void, )
| 301 | }))(); |
| 302 | |
| 303 | export function createViewEffect( |
| 304 | view: LView, |
| 305 | notifier: ChangeDetectionScheduler, |
| 306 | fn: (onCleanup: EffectCleanupRegisterFn) => void, |
| 307 | ): ViewEffectNode { |
| 308 | const node = Object.create(VIEW_EFFECT_NODE) as ViewEffectNode; |
| 309 | node.view = view; |
| 310 | node.zone = typeof Zone !== 'undefined' ? Zone.current : null; |
| 311 | node.notifier = notifier; |
| 312 | node.userFn = fn; |
| 313 | node.fn = createEffectFn(node, fn); |
| 314 | |
| 315 | view[EFFECTS] ??= new Set(); |
| 316 | view[EFFECTS].add(node); |
| 317 | |
| 318 | node.consumerMarkedDirty(node); |
| 319 | return node; |
| 320 | } |
| 321 | |
| 322 | export function createRootEffect( |
| 323 | fn: (onCleanup: EffectCleanupRegisterFn) => void, |
no test coverage detected