DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

Angular Signals: How Reactivity Works and Which API to Use

Angular Signals connect state changes to the code that reads them. Learn which API fits writable, derived, dependent, asynchronous, and imperative work.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Angular Signals track where application state is read and notify the relevant consumers when it changes. Use signal() for writable state, computed() for synchronous derived values, linkedSignal() for dependent state that must stay editable, resources for asynchronous results, and effect() to synchronize with systems outside Angular’s signal graph.

What reactivity with signals means in Angular

A signal is a value that Angular can observe. Read one by calling it, such as count(). When that read happens inside a reactive consumer—such as a computed derivation, an effect, or a component template—Angular records the dependency. When the signal changes, Angular can notify the consumers that depend on it.

As an Amazon Associate I earn from qualifying purchases.

In an OnPush component, reading a signal in the template marks that component for a future update when the signal changes. This gives Angular targeted scheduling information; it does not eliminate change detection or guarantee that an application will automatically become faster. See Angular’s Signals overview.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose an API by the job state needs to do

Need API Why it fits
Mutable state owned by application logic signal() Read and update a writable value with set() or update().
A read-only value determined by other state computed() Derives and memoizes a value from the signals read during its calculation.
An editable value constrained by changing source state linkedSignal() Maintains writable dependent state and can choose a new valid value when its source changes.
An asynchronous result tied to reactive parameters resource() or httpResource() Represents request values and status through signals.
Interaction with a non-signal system effect() Runs imperative work when tracked signal dependencies change.

Use signal() for writable source state

A writable signal holds a value, which may be a primitive or a complex object. Call it to read; use set() to replace the value or update() to calculate a replacement from the current value:

const count = signal(0);
count.set(3);
count.update(value => value + 1);

A read-only signal view does not expose set() or update(), but it does not deep-freeze an object held by the signal. Avoid mutating nested values in place when consumers depend on change notifications; replace or update state in a way that produces the changes your application expects.

Use computed() for synchronous derived state

When a value is determined by other state, derive it rather than storing a second copy that must be kept synchronized. A computed signal is read-only, lazy, and memoized: Angular runs its calculation when the value is needed and caches the result until a dependency changes.

const fullName = computed(() => firstName() + ' ' + lastName());

Dependencies are dynamic. Angular tracks only the signals read on the most recent execution of the calculation, so conditional logic can change which signals invalidate the result. This makes computed signals suitable for transformations, filtered values, and other synchronous derivations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use linkedSignal() when dependent state must remain editable

Sometimes a value depends on a changing source but also represents a user choice. A selected shipping method, for example, must be one of the currently available methods. A basic linked signal can choose a default from the current options. Its source-and-computation form can also inspect the previous state: preserve the selection if it remains valid, or choose a fallback when it does not.

That distinction matters: computed() is for a derived value that consumers do not edit; linkedSignal() is for a dependent value that needs to remain writable while respecting changing source state. See Angular’s linkedSignal guide.

Use resources for asynchronous work

Signals such as signal(), computed(), and input() are synchronous. A resource connects reactive parameters to an asynchronous loader and exposes request state, including value, status, loading, and error information, so the UI can represent pending and failed requests.

When parameters change while a loader is running, Angular documents using an AbortSignal to abort the outstanding operation. If the parameter computation returns undefined, the resource stays idle. Use a loader for one result per request; for ongoing streams such as WebSockets or server-sent events, Angular’s guide describes stream resources.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

resource() or httpResource()?

Use resource() when you need to define the asynchronous loader. Use httpResource() when the request should use Angular’s HttpClient: it exposes response and request status as signals and uses the Angular HTTP stack, including interceptors. Availability and API details can vary by Angular version, so check the documentation for the version used by your project: resource guide and httpResource guide.

Reserve effect() for imperative boundaries

An effect tracks the signals it reads and runs at least once, then runs again when those dependencies change. Appropriate uses include logging, syncing to storage, custom DOM behavior, or updating a canvas or third-party library. Angular’s guidance is to reach for effects only when synchronizing with a non-signal system; the framework describes them as “the last API you reach for.” See Side effects for non-reactive APIs.

Do not use an effect merely to copy one signal into another. That is ordinary state propagation, better expressed with computed() for read-only derivation or linkedSignal() for dependent writable state. Copying through effects adds synchronization work and can cause expression-changed errors, circular updates, or unnecessary change detection.

Effects need an injection context by default, although an injector can be provided in their options. Their timing and lifetime depend on context and Angular version. An effect can also use cleanup logic to cancel work before its next run or when it is destroyed. For imperative DOM work that must happen after Angular commits a render, consider afterRenderEffect and verify its exact behavior in the API documentation for your version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Adopt signal inputs and queries selectively

Angular’s migration references identify signal inputs and signal queries as production ready as of v19. The signal-input schematic converts @Input() members to input() and updates references in templates, host bindings, and TypeScript. The signal-query schematic converts @ViewChild, @ViewChildren, @ContentChild, and @ContentChildren members to signal equivalents and updates their references.

These schematics are migration aids, not a reason to convert an entire codebase at once. Review generated changes and account for the project’s source and target Angular versions. See the signal inputs migration reference and signal queries migration reference.

A practical decision rule

  1. Keep one writable signal as the source of truth for state your application owns.
  2. Derive synchronous values with computed() instead of manually synchronizing duplicate state.
  3. Choose linkedSignal() if a dependent value must be user-editable and remain valid as its source changes.
  4. Model asynchronous requests with resource() or httpResource(), including pending and error states.
  5. Use effect() only when a change must cross into an imperative system that does not participate in signal reactivity.

The Angular signals overview linked here is for v20 documentation. Other Angular documentation pages may evolve independently, and details—especially resource APIs and effect timing—are version-sensitive. Check the API reference matching your project before relying on exact behavior.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.