Skip to main content
Home

@cjc/signal@0.3.5
Built and signed on GitHub Actions

A declarative design pattern for reactive state management, developed with Deno

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
5 days ago (0.3.5)
function computed
computed<T>(
compute: () => T,
equals?: (
a: T,
b: T,
) => boolean
,
): ReadonlySignal<T>

Creates a ReadonlySignal, whose value is generated by the provided compute function.

Type Parameters

Parameters

compute: () => T

a function to generate the Signal's value

optional
equals: (
a: T,
b: T,
) => boolean

(optional) a function for comparing new and old values of this Signal

Return Type

ReadonlySignal<T>

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@cjc/signal

Import symbol

import { computed } from "@cjc/signal";
or

Import directly with a jsr specifier

import { computed } from "jsr:@cjc/signal";

Add Package

pnpm i jsr:@cjc/signal
or (using pnpm 10.8 or older)
pnpm dlx jsr add @cjc/signal

Import symbol

import { computed } from "@cjc/signal";

Add Package

yarn add jsr:@cjc/signal
or (using Yarn 4.8 or older)
yarn dlx jsr add @cjc/signal

Import symbol

import { computed } from "@cjc/signal";

Add Package

vlt install jsr:@cjc/signal

Import symbol

import { computed } from "@cjc/signal";

Add Package

npx jsr add @cjc/signal

Import symbol

import { computed } from "@cjc/signal";

Add Package

bunx jsr add @cjc/signal

Import symbol

import { computed } from "@cjc/signal";