ironbar/services/default/index.js

16 lines
418 B
JavaScript

const {createDispatcher} = require('@truss/comm');
const dispatcher = createDispatcher();
dispatcher.lookupActions(require('./actions'));
dispatcher.lookupHooks(require('./hooks'));
dispatcher.connect();
if (module.hot) {
module.hot.accept('./actions', () => {
dispatcher.lookupActions(require('./actions'));
});
module.hot.accept('./hooks', () => {
dispatcher.lookupHooks(require('./hooks'));
});
}