2016-05-11 14:07:13 +07:00
2016-05-11 13:51:17 +07:00
2016-05-11 14:07:13 +07:00
.
2016-05-11 01:09:53 +07:00
.
2016-05-11 01:09:53 +07:00
2016-05-11 13:51:17 +07:00
.
2016-05-11 01:09:53 +07:00
2016-05-11 13:51:17 +07:00
2016-05-11 14:07:13 +07:00
.
2016-05-11 01:09:53 +07:00

choo stability

npm version build status test coverage downloads js-standard-style

A framework for creating sturdy web applications. Built on years of industry experience and distills the essence of functional architectures into a productive package.

Features

  • minimal size: weighing under 8kb, choo is a tiny little framework
  • single state: immutable single state helps reason about changes
  • minimal tooling: built for the cutting edge browserify compiler
  • transparent side effects: using "effects" and "subscriptions" brings clarity to IO
  • omakase: composed out of a balanced selection of open source packages
  • idempotent: renders seemlessly in both Node and browsers
  • very cute: choo choo!

Usage

const choo = require('choo')

const app = choo()
app.model('title', {
  state: { title: 'my-demo-app' },
  reducers: {
    'update': (action, state) => ({ title: action.payload })
  },
  effects: {
    'update': (action, state, send) => (document.title = action.title)
  }
})

const mainView = (params, state, send) => choo.view`
  <main class="app">
    <h1>${state.title}</h1>
    <label>Set the title</label>
    <input
      type="text"
      placeholder=${state.title}
      oninput=${(e) => send('title:update', { payload: e.target.value })}>
  </main>
`

app.router((route) => [
  route('/', mainView)
])

const node = app.start()
document.body.appendChild(node)

Concepts

  • state:
  • reducers:
  • effects:
  • subscriptions:

API

choo

Packages used

Installation

$ npm install choo

License

MIT

S
Description
A modern fork of choo using vite
Readme MIT
873 KiB
Languages
JavaScript 99.7%
TypeScript 0.3%