Interface: Signal<T>

index.Signal

Interface representing a mutable reactive signal container.

Remarks

A Signal wraps a value in a reactive container. Accessing the .value property inside a reactive context (such as an effect or computed) registers a dependency edge. Assigning a new value to .value triggers reactive invalidation across all downstream consumers.

Example

import { signal, effect } from '@banksia/signals';

const count = signal(0);
effect(() => console.log('Count:', count.value)); // Logs: Count: 0
count.value = 1; // Logs: Count: 1

Type parameters

Name Description
T The type of value stored within the signal.

Implemented by

Table of contents

Properties

Properties

value

value: T

The current value of the signal.

Reading this property establishes a dependency in the active reactive context. Modifying this property triggers updates in all subscribers.