pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://angular.dev/api/core/effect

|| (theme === 'auto' && prefersDark)) { documentClassList.add(DARK_MODE_CLASS_NAME); } else { documentClassList.add(LIGHT_MODE_CLASS_NAME); } if (location.search.includes('uwu')) { documentClassList.add('uwu'); } effect • Angular
    • Overview
@angular/core

effect

function
stablesince v20.0

Registers an "effect" that will be scheduled & executed whenever the signals that it reads changes.

API

function effect(
  effectFn: (onCleanup: EffectCleanupRegisterFn) => void,
  options?: CreateEffectOptions | undefined,
): EffectRef;
@parameffectFn(onCleanup: EffectCleanupRegisterFn) => void
@paramoptionsCreateEffectOptions | undefined
@returnsEffectRef

Description

Registers an "effect" that will be scheduled & executed whenever the signals that it reads changes.

Angular has two different kinds of effect: component effects and root effects. Component effects are created when effect() is called from a component, directive, or within a service of a component/directive. Root effects are created when effect() is called from outside the component tree, such as in a root service.

The two effect types differ in their timing. Component effects run as a component lifecycle event during Angular's synchronization (change detection) process, and can safely read input signals or create/destroy views that depend on component state. Root effects run as microtasks and have no connection to the component tree or change detection.

effect() must be run in injection context, unless the injector option is manually specified.

Jump to details
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy