react_ujs
Version:
Rails UJS for the react-rails gem
15 lines (13 loc) • 421 B
JavaScript
module.exports = {
// pjax support
setup: function(ujs) {
ujs.handleEvent('ready', ujs.handleMount);
ujs.handleEvent('pjax:end', ujs.handleMount);
ujs.handleEvent('pjax:beforeReplace', ujs.handleUnmount);
},
teardown: function(ujs) {
ujs.removeEvent('ready', ujs.handleMount);
ujs.removeEvent('pjax:end', ujs.handleMount);
ujs.removeEvent('pjax:beforeReplace', ujs.handleUnmount);
},
}