oolon-startapp

3.0.0 • Public • Published

StartApp

Usage

import app from 'startapp'
app({
  model: {title: 'Hello world'},
  update: {
    setTitle: (state, title) =>
      [{...state, title}]
  },
  view: (state, msg) =>
    ReactDOM.render(<App {...{model, msg}} />, document.getElementById('root')),
  subs: [ // called when dom content is loaded
    (state, msg) => document.body.addEventListener('click', () => msg.setTitle('Body clicked'))
  ]
}

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i oolon-startapp

    Weekly Downloads

    8

    Version

    3.0.0

    License

    MIT

    Last publish

    Collaborators

    • oolon