In Solid.js, we can easily create a derivative that updates when any of its dependencies are changed. import { createSignal, createEffect } from "solid-js";
const [time, setTime] = createSignal(0);
const x = () => 20 * time();
createEffect(() => console.log(x()); However, things becomes tricky once we start introducing asynchronous computations…