Angular · Function
effect
Registers a function that runs when signals read by that function change. Angular creates either a component effect or a root effect, with different timing and change-detection behavior.
Last updated
Syntax
effect(effectFn: (onCleanup: EffectCleanupRegisterFn) => void, options?: CreateEffectOptions | undefined): EffectRef;In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
EffectCleanupFnEffectCleanupRegisterFnEffectRefCreateEffectOptionssignal