-
- All Implemented Interfaces:
-
com.facebook.react.bridge.JavaScriptModule
public interface HMRClient implements JavaScriptModule
JS module interface for HMRClient
The HMR(Hot Module Replacement)Client allows for the application to receive updates from Metro (over a web socket), allowing for injection of JavaScript to the running application (without a refresh).
-
-
Method Summary
Modifier and Type Method Description abstract void
setup(String platform, String bundleEntry, String host, int port, boolean isEnabled)
Enable the HMRClient so that the client will receive updates from Metro. abstract void
registerBundle(String bundleUrl)
Registers an additional JS bundle with HMRClient. abstract void
enable()
Sets up a connection to the packager when called the first time. abstract void
disable()
Turns off the HMR client so it doesn't process updates from the packager. -
-
Method Detail
-
setup
abstract void setup(String platform, String bundleEntry, String host, int port, boolean isEnabled)
Enable the HMRClient so that the client will receive updates from Metro.
- Parameters:
platform
- The platform in which HMR updates will be enabled.bundleEntry
- The path to the bundle entry file (e.g.host
- The host that the HMRClient should communicate with.port
- The port that the HMRClient should communicate with on the host.isEnabled
- Whether HMR is enabled initially.
-
registerBundle
abstract void registerBundle(String bundleUrl)
Registers an additional JS bundle with HMRClient.
-
enable
abstract void enable()
Sets up a connection to the packager when called the first time. Ensures code updates receivedfrom the packager are applied.
-
disable
abstract void disable()
Turns off the HMR client so it doesn't process updates from the packager.
-
-
-
-