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'))
  ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i oolon-startapp

Weekly Downloads

0

Version

3.0.0

License

MIT

Last publish

Collaborators

  • oolon