createComputed (src/computed.ts)

angular · packages/core/primitives/signals/src/computed.ts · typescript · MIT
ui, tag:knn-classified

Creates a computed reactive signal that derives values from a function.

// Source: https://github.com/angular/angular | License: MIT | Copyright 2010-2026 Google LLC. https://angular.dev/license
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.dev/license
 */

import {defaultEquals, ValueEqualityFn} from './equality';
import {
  consumerAfterComputation,
  consumerBeforeComputation,
  producerAccessed,
  producerUpdateValueVersion,
  REACTIVE_NODE,
  ReactiveNode,
  runPostProducerCreatedFn,
  setActiveConsumer,
  SIGNAL,
} from './graph';

// Required as the signals library is in a separate package, so we need to explicitly ensure the
// global `ngDevMode` typ

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key