Introduction
Let's get started
Read the blog post
Take a deep dive into the thinking behind Signals and Signalium
Explore core concepts
Learn the core components of Signalium-based reactivity
API reference
Check out the API docs
Reactivity.
Beyond React.
Functional, performant, signal-based hooks
Reactivity.
Beyond React.
Functional, performant, signal-based hooks
In 2018, React revolutionized the frontend world with Hooks, fundamentally shifting how we approached functional reactivity.
However, time has revealed some significant problems. Endless dependency lists, performance issues, and complex side-effects plague applications at scale, with even the most disciplined developers struggling to avoid common pitfalls.
What if there was an easier way?
With Signalium, you get the ergonomics of Hooks without the complexity. And it works everywhere.
Standard hooks count: 0.
Rendered 1 times.
const useCounter = (ms) => {
const [count, setCount] = useState(0);
useEffect(() => {
const id = setInterval(() => {
setCount((count) => count + 1);
}, ms);
return () => clearInterval(id);
}, [ms]);
return count;
};
const useDivide = (value, divideBy) => value / divideBy;
const useFloor = (value) => Math.floor(value);
const useQuotient = (value, divideBy) =>
useFloor(useDivide(value, divideBy));
const useFloorCounter = () => useQuotient(useCounter(5000), 3);
let renderCount = 0;
export default function Component() {
const value = useFloorCounter();
return (
<div className="flex flex-col px-4 md:py-12 text-center md:text-lg">
<p className="text-xl md:text-2xl">Standard hooks count: {value}.</p>
<p>Rendered {++renderCount} times.</p>
</div>
)
}
Signal hooks count: 0.
Rendered 1 times.
const useCounter = subscription((state, ms) => {
const id = setInterval(() => state.set(state.get() + 1), ms)
return () => clearInterval(id)
}, { initValue: 0 });
const useDivide = computed((value, divideBy) =>
value / divideBy
);
const useFloor = computed((value) => Math.floor(value));
const useQuotient = computed((value, divideBy) =>
useFloor(useDivide(value, divideBy))
);
const useFloorCounter = computed(() =>
useQuotient(useCounter(5000), 3)
);
let renderCount = 0;
export default function Component() {
const value = useFloorCounter();
return (
<div className="flex flex-col px-4 md:py-12 text-center md:text-lg">
<p className="text-xl md:text-2xl">Signal hooks count: {value}.</p>
<p>Rendered {++renderCount} times.</p>
</div>
)
}
Introduction
Take a deep dive into the thinking behind Signals and Signalium
Learn the core components of Signalium-based reactivity
Check out the API docs