Projects
View on GitHub
dai-shi/use-signals
About
An experimental React hook for TC39 signals
Web & App DevelopmentMeasured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originaluse-signals
An experimental React hook for TC39 signals
Install
npm install use-signals
Usage
import { Signal, useSignal } from 'use-signals';
const counter = new Signal.State(0);
const Counter = () => {
const count = useSignal(counter);
const inc = () => counter.set(counter.get() + 1);
return (
<>
<div>Count: {count}</div>
<button type="button" onClick={inc}>
+1
</button>
</>
);
};
Examples
The examples folder contains working examples. You can run one of them with
PORT=8080 pnpm run examples:01_counter
and open http://localhost:8080 in your web browser.
You can also try them directly: 01 02
Tweets
Explore related projects
Loading…