5.0.0 • Published 7 years ago

choo-resume v5.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

choo-resume

choo-resume + hot-rld = hot app reload in choo 🔥

For choo v3 use v1.x, for choo v4 use v2.x, v3.x, for choo v5 use v4.x.

Usage

  • Install npm i --save-dev hot-rld choo-resume or yarn add --dev hot-rld choo-resume
  • Run the hot reload cli hot-rld -s static js/*.js
  • Add the hot reload client to your page <script src=${require('hot-rld/client')}</script>
  • Win! Profit! etc.
const resume = require('choo-resume')

// Basic usage
const appRoot = document.getElementById('app-root')
if (appRoot) appRoot.parentNode.removeChild(appRoot)

const tree = resume(app).start()
document.body.appendChild(tree)

// Rehydration usage

// Ensure your root element has a data attribute like
// the following when rendered from the server:
//   <div data-server-rendered></div>
const appRoot = document.getElementById('app-root')
const rehydrating = !!appRoot.dataset.serverRendered
const tree = app.start()
if (rehydrating) {
  app.mount('#app-root');
} else {
  appRoot.parentNode.removeChild(appRoot)
  document.body.appendChild(tree)
}

Installation

$ npm install --save choo-resume

or

$ yarn add choo-resume

License

MIT

5.0.0

7 years ago

4.0.0

7 years ago

3.0.0

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago

1.0.0-0

8 years ago