import { h, app } from "hyperapp"
import { delay } from "@hyperapp/time"
const Decrement = (state) => state - 1
app({
init: 0,
view: (state) =>
h("div", {}, [
h("h1", {}, state),
h("button", {
onclick: (state/*, event*/) => [state, delay(100, Decrement)],
}, "subtract"
),
h("button", { onclick: (state) => state + 1 }, "add"),
]),
node: document.getElementById("app"),
})
See how you never actually called setTimeout as that would be a side effect.
> Their attitude since then has left a lot to be desired.
That refers to the forker's attitude following the tweets[4][5].
[1]: https://github.com/ai/nanocolors/pull/14#issuecomment-927757...
[2]: https://user-images.githubusercontent.com/56996/135221889-52...
[3]: https://twitter.com/jorgebucaran/status/1442055448899641348
[4]: https://news.ycombinator.com/item?id=28661094
[5]: https://github.com/jorgebucaran/colorette/issues/78