simple-react-signal
v1.8.0
Published
Simple signal library for React. Can be used to create reactive values outside of the React lifecycle.
Downloads
315
Readme
simple-react-signal
This is a simple signal library to create reactive values outside of the React lifecycle.
Usage
import { createSignal } from 'simple-react-signal';
const mySignal = createSignal('foo');
export function App() {
const [value, setValue] = mySignal.use();
const handleSetBar = () => {
setValue('bar');
}
return (
<button onClick={handleSetBar}>Set bar</button>
);
}