UNPKG

@hippy/debug-server-next

Version:
18 lines (14 loc) 444 B
import hotEmitter from '../hot/emitter'; import { log } from './log'; import applyReload from './apply-reload'; function reloadApp({ hot, liveReload }, status) { const { currentHash, previousHash } = status; if (currentHash === previousHash) return; if (hot) { log.info('App hot update...'); hotEmitter.emit('webpackHotUpdate', status.currentHash); } else if (liveReload) { applyReload(); } } export default reloadApp;