Public
Edited
Oct 11, 2023
Fork of SolidJS
Insert cell
Insert cell
bluefish = import("https://cdn.skypack.dev/@bluefish-js/solid")
Insert cell
function ButtonFn(props) {
return h("button", props)
}
Insert cell
Button = createComponent(ButtonFn);
Insert cell
x = 7
Insert cell
function Counter(props) {
const [count, setCount] = createSignal(0);
const increment = (e) => setCount(c => c + props.x);

return Button({ onClick: increment }, count);
}
Insert cell
hroot = document.createElement("div");
Insert cell
hroot.setAttribute("id", "app");
Insert cell
render(Counter, document.getElementById("app"));
Insert cell
// import { render } from "solid-js/web";
// import h from "solid-js/h";
// import { createSignal } from "solid-js";
web = import("https://cdn.skypack.dev/solid-js/web")
Insert cell
render = web.render
Insert cell
createComponent = (fn) => (...args) => {
return h(fn, ...args);
}
Insert cell
h_package = import("https://cdn.skypack.dev/solid-js/h")
Insert cell
h = h_package.default
Insert cell
createSignal = solid.createSignal
Insert cell
solid = import("https://cdn.skypack.dev/solid-js")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more