Published
Edited
Jan 30, 2021
Also listed in…
API
Insert cell
md`# Hello, Haunted!`
Insert cell
html`React's hooks in WebComponents <a href="https://github.com/matthewp/haunted">https://github.com/matthewp/haunted</a>`
Insert cell
{
yield html`<my-counter></my-counter>`
function Counter() {
const [count, setCount] = haunted.useState(0);

return haunted.html`
<div id="count">${count}</div>
<button type="button" @click=${() => setCount(count + 1)}>
Increment
</button>
`;
}
customElements.define('my-counter', haunted.component(Counter));
}
Insert cell
haunted = require('https://bundle.run/haunted@4.7.1')
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