A client for communicating with hot module replacement (HMR)
Please ★ this repo if you found it useful ★ ★ ★
- listen to connected event
- listen to close event
- listen to hash event
- listen to still-ok event
- listen to content-changed event
- listen to warnings event
- listen to errors event
- listen to ok event
npm install --save hmr-client
import HRMClient from 'hmr-client';
const client = new HMRClient({ port: 3000 });
client.onConnected = () => {
console.log('connected');
};
client.onHash = message => {
console.log('hash', message.data)
};
client.onStillOk = () => {
console.log('still-ok');
};
client.onOk = () => {
console.log('ok');
};
client.onContentChanged = () => {
console.log('content-changed');
};
client.onWarnings = message => {
console.log('warnings', message);
};
client.onErrors = message => {
console.log('errors', message);
};
client.onClose = () => {
console.log('close');
console.log(
'The development server has disconnected.\n' +
'Refresh the page if necessary.'
);
};
Submit an issue
Contribute a screenshot
Review the guidelines for contributing
Jam Risser © 2018
Review the changelog
- Jam Risser - Author
A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.
Add some fuel if you'd like to keep me going!