タグ

ブックマーク / qiita.com/JorgeBucaran (1)

  • 2018 年は Hyperapp の年だ - Qiita

    import { app } from "hyperapp" import { div, h1, button } from "@hyperapp/html" const state = { count: 0 } const actions = { down: value => state => ({ count: state.count - value }), up: value => state => ({ count: state.count + value }) } const view = (state, actions) => div([ h1(state.count), button({ onclick: () => actions.down(1) }, "–"), button({ onclick: () => actions.up(1) }, "+") ]) const

    2018 年は Hyperapp の年だ - Qiita
    Nyoho
    Nyoho 2017/12/28
    考え方がいいねえ。試してみよう。
  • 1