Skip to content

Commit

Permalink
Hot unreload stores
Browse files Browse the repository at this point in the history
  • Loading branch information
goatslacker committed Jun 7, 2015
1 parent 7cf737d commit 66c875c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/utils/makeHot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function makeHot(alt, Store, name = Store.displayName) {
if (module.hot) {
module.hot.dispose(() => {
delete alt.stores[name]
})
}

return alt.createStore(Store, name)
}

export default makeHot

0 comments on commit 66c875c

Please sign in to comment.