MCPcopy
hub / github.com/stackblitz/alien-signals / computed

Function computed

src/index.ts:153–163  ·  view source on GitHub ↗
(getter: (previousValue?: T) => T)

Source from the content-addressed store, hash-verified

151}
152
153export function computed<T>(getter: (previousValue?: T) => T): () => T {
154 return computedOper.bind({
155 value: undefined,
156 subs: undefined,
157 subsTail: undefined,
158 deps: undefined,
159 depsTail: undefined,
160 flags: ReactiveFlags.None,
161 getter: getter as (previousValue?: unknown) => unknown,
162 }) as () => T;
163}
164
165export function effect(fn: () => void | (() => void)): () => void {
166 const e: EffectNode = {

Callers 5

computedFunction · 0.90
effect.spec.tsFile · 0.90
trigger.spec.tsFile · 0.90
propagate.mjsFile · 0.50
memoryUsage.mjsFile · 0.50

Calls

no outgoing calls

Tested by 1

computedFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…