UNPKG

signal-polyfill

Version:

A polyfill for the TC39 Signal proposal.

19 lines (17 loc) • 522 B
/** * @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.io/license */ /** * A comparison function which can determine if two values are equal. */ export type ValueEqualityFn<T> = (a: T, b: T) => boolean; /** * The default equality function used for `signal` and `computed`, which uses referential equality. */ export function defaultEquals<T>(a: T, b: T) { return Object.is(a, b); }