Hot reloading

This is for:

Developer

The Qubit CLI hot reloading feature allows you to preview updates to your experience without a full page refresh.

This can provide a faster feedback cycle and avoid needing to repeat manual steps to get the page into a state where your experience can fire.

By default, the local server will refresh the page when you make a change.

However, if you register any cleanup functions using options.onRemove (see below), we assume that calling those functions will undo any side effects, and that we can therefore re-execute your experience or Placement without having to refresh the page. This effectively enables hot reloading.

module.exports = function variation (options) {
  options.onRemove(cleanup)
}

module.exports = function triggers (options) {
  options.onRemove(cleanup)
}

module.exports = function renderPlacement ({ onRemove }) {
  onRemove(cleanup)
}