Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

hmr-client

codejamninja33MIT0.1.3

A client for communicating with hot module replacement (HMR)

hmr-client, hmr, hot-module-replacement

readme

hmr-client

GitHub stars

A client for communicating with hot module replacement (HMR)

Please ★ this repo if you found it useful ★ ★ ★

Features

  • 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

Installation

npm install --save hmr-client

Dependencies

Usage

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.'
  );
};

Support

Submit an issue

Screenshots

Contribute a screenshot

Contributing

Review the guidelines for contributing

License

MIT License

Jam Risser © 2018

Changelog

Review the changelog

Credits

Support on Liberapay

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!

Liberapay receiving Liberapay patrons

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[0.0.1] - 2018-09-28

Added

  • initial release