Permalink
Browse files

simplified hmr example further

  • Loading branch information...
1 parent 36a9d25 commit e21ccd34f63be30baa387fa846874602d6150c08 @substack committed Sep 1, 2015
Showing with 4 additions and 14 deletions.
  1. +2 −7 example/hmr/main.js
  2. +2 −7 readme.markdown
View
@@ -1,8 +1,3 @@
-function render () {
- document.body.textContent = require('./msg.js')
-}
-render()
+document.body.textContent = require('./msg.js')
-if (module.hot) {
- module.hot.accept()
-}
+if (module.hot) module.hot.accept()
View
@@ -668,14 +668,9 @@ updates, then the file is re-executed with the new code.
For example, if we have a file, `main.js`:
``` js
-function render () {
- document.body.textContent = require('./msg.js')
-}
-render()
+document.body.textContent = require('./msg.js')
-if (module.hot) {
- module.hot.accept()
-}
+if (module.hot) module.hot.accept()
```
and a file `msg.js`:

0 comments on commit e21ccd3

Please sign in to comment.