Skip to content

Commit a0caf99

Browse files
committed
Add hot module replacement
1 parent 923f3c1 commit a0caf99

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "purescript-webpack-example",
33
"private": true,
44
"dependencies": {
5-
"purescript-prelude": "^2.1.0"
5+
"purescript-prelude": "^2.1.0",
6+
"purescript-eff": "^2.0.0"
67
}
78
}

src/Entry.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
exports.hot = function() {
4+
if (module.hot) {
5+
module.hot.accept();
6+
}
7+
}

src/Entry.purs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
module Entry (module Entry) where
22

3+
import Prelude (Unit)
4+
5+
import Control.Monad.Eff (Eff)
6+
import Control.Monad.Eff.Unsafe (unsafePerformEff)
7+
38
import Prelude ((<>)) as Entry
49

510
import Example.Test (testing) as Entry
611

712
import Example.Foo (bar, foo, foot, jaz, meter) as Entry
813

914
import Example.Foo.Baz (baz) as Entry
15+
16+
foreign import hot :: forall eff. Eff eff Unit
17+
18+
result :: Unit
19+
result = unsafePerformEff hot

0 commit comments

Comments
 (0)