Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bengourley/choo-resume
choo-resume + hot-rld = hot app reload in choo
https://github.com/bengourley/choo-resume
Last synced: 2 months ago
JSON representation
choo-resume + hot-rld = hot app reload in choo
- Host: GitHub
- URL: https://github.com/bengourley/choo-resume
- Owner: bengourley
- Created: 2016-11-02T17:49:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-23T14:12:55.000Z (almost 8 years ago)
- Last Synced: 2024-04-25T11:03:23.432Z (8 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 15
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
- awesome-choo - choo-resume - choo-resume + hot-rld = hot app reload in choo. (Uncategorized / Uncategorized)
README
# choo-resume
choo-resume + [hot-rld](https://github.com/bengourley/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 v5.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 ``
- Win! Profit! etc.```js
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
```sh
$ npm install --save choo-resume
```
or
```sh
$ yarn add choo-resume
```## License
[MIT](https://tldrlegal.com/license/mit-license)