Macil / browserify-hmr

Hot Module Replacement plugin for Browserify
MIT License
373 stars 26 forks source link

add unaccepted handler #20

Closed ashaffer closed 8 years ago

ashaffer commented 8 years ago

Fixes #15. Adds an unaccepted handler thing, so you can do this:

if (module.hot) {
  module.hot.unaccepted(() => window.location.reload())
  module.hot.decline()
  module.hot.accept(['./reducer', './app'], () =>
    hmr.replace(require('./app').default, require('./reducer').default))
}

The unaccepted callbacks just get called if a module has been declined is saved.

ashaffer commented 8 years ago

Any movement on this?

Macil commented 8 years ago

Sorry, I think you did something wrong with this pull request. The code didn't show up here at first and doesn't seem to be technically part of it.

Does this fix issue #14? There's a lot of brokenness in bubbling up changes right now, and I'm not comfortable adding functionality that exposes the brokenness more until that's fixed. I'll look into it more tonight.

ashaffer commented 8 years ago

Ya sorry, I accidentally force pushed over my changes when trying to merge in your most recent stuff. this branch has my change though.