Skip to content

Commit 88682f1

Browse files
committed
Only hot reload when available
1 parent 9e4a0d3 commit 88682f1

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

examples/counter/dispatcher.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ const dispatcher =
88

99
dispatcher.receive(stores, actions);
1010

11-
module.hot.dispose(data => {
12-
data.dispatcher = dispatcher;
13-
});
11+
if (module.hot) {
12+
module.hot.dispose(data => {
13+
data.dispatcher = dispatcher;
14+
});
15+
}
1416

1517
export default dispatcher;

examples/todo/dispatcher.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ const dispatcher =
88

99
dispatcher.receive(stores, actions);
1010

11-
module.hot.dispose(data => {
12-
data.dispatcher = dispatcher;
13-
});
11+
if (module.hot) {
12+
module.hot.dispose(data => {
13+
data.dispatcher = dispatcher;
14+
});
15+
}
1416

1517
export default dispatcher;

0 commit comments

Comments
 (0)