Skip to content

nonbili/purescript-halogen-hmr-example

Repository files navigation

purescript-halogen HMR Example

demo

How to

  1. copy src/Halogen.Component.patch.js to your codebase
  2. change webpack.config.js to point Halogen.Component/index.js to the patched version
  alias: {
    "../Halogen.Component/index.js": "Halogen.Component.patch.js"
  }
  1. setup hmr in your entry script
if (module.hot) {
  module.hot.accept("Main", function() {
    document.body.innerHTML = "";
    require("Main").main();
  });
}

NOTE: only tested with purescript-halogen master.

About

An example to persist component state across webpack hot reloading

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published