LogoRobo.js
Framework

HotModule

Interface: HotModule

Interface returned by hmr.module() for registering cleanup callbacks and accessing persisted data across reloads.

Properties

PropertyTypeDescription
dataRecord<string, unknown>Persisted data that survives across reloads. Use this to preserve state like singleton instances.

Methods

dispose()

dispose(callback): void

Register a cleanup callback for when this module is reloaded. Multiple callbacks can be registered and will run in order. Async callbacks are fire-and-forget (started but not awaited).

Parameters

ParameterType
callbackDisposeCallback

Returns

void

On this page