whatisgithub

What is signals?

webreflection/signals — explained in plain English

Analysis updated 2026-05-18

29PythonAudience · developerComplexity · 2/5Setup · easy

In one sentence

A tiny 0.5KB JavaScript library that brings Preact-style reactive signals, computed values, and effects to any JavaScript environment.

Mindmap

mindmap
  root((signals))
    What It Does
      Reactive signals
      Computed values
      Effects
      Batching
    Tech Stack
      JavaScript
      0.5KB minified
    Use Cases
      Reactive state
      Framework free reactivity
      Auto recalculation
    Audience
      Developers
      Library authors

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add reactive state to a project without pulling in a full framework.

USE CASE 2

Build computed values that automatically recalculate when their dependencies change.

USE CASE 3

Batch multiple signal updates so subscribers only re-run once.

USE CASE 4

Read a signal's value without subscribing to future changes using untracked.

What is it built with?

JavaScript

How does it compare?

webreflection/signalsadityasharmadotai-hash/docs-reader-rag-agentalekseiul/hermes-researcher-agent
Stars292929
LanguagePythonPythonPython
Setup difficultyeasyeasymoderate
Complexity2/52/52/5
Audiencedevelopervibe coderresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

So what is it?

@webreflection/signals is a small JavaScript library that brings Preact-style reactive signals to any JavaScript environment. After minification and compression the entire module weighs about 0.5KB. Signals in this library work the same way they do in Preact: a signal holds a value, and any computed value or effect that reads it during execution automatically subscribes to future changes. When a signal's value is updated, subscribed effects re-run and subscribed computed values are marked stale and recalculated on their next read. The library provides the core set of primitives: signal, computed, effect, batch, and untracked. A notable design decision is that effects do not track what they subscribed to. Instead, each signal or computed stores references to its subscribers. When an outer effect is running and an inner effect is encountered, the inner effect is disposed so the outer one takes sole responsibility. This prevents nested effects from creating duplicate subscriptions and ensures effects always run top-down in the correct order. The same stale guard used by computed values applies to effects: when multiple signals ask the same effect to re-run, only the first invalidation matters until that effect has actually executed again. The batch function defers subscriber notifications until the batch is complete, then filters out any subscribers invalidated before they ran. The untracked function temporarily disables subscription tracking, useful when you want to read a signal's current value without creating a dependency on future changes. The computed type adds read-only semantics: its value refreshes only when a dependency changes and the value is accessed, not eagerly. A disposable export provides a lifecycle-aware variant of effect, equivalent to Preact's createModel utility, that cleans itself up automatically when it is no longer needed. The README includes detailed in-depth explanations of each primitive through expandable sections.

Copy-paste prompts

Prompt 1
Show me how to create a signal and an effect that reacts to it using @webreflection/signals.
Prompt 2
Explain how computed values stay in sync with their dependencies in this library.
Prompt 3
Write a small example using batch to group multiple signal updates together.
Prompt 4
How does the disposable export differ from a regular effect in @webreflection/signals?

Frequently asked questions

What is signals?

A tiny 0.5KB JavaScript library that brings Preact-style reactive signals, computed values, and effects to any JavaScript environment.

What language is signals written in?

Mainly Python. The stack also includes JavaScript.

How hard is signals to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is signals for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.