Classseedcordv0.10.6
HmrModuleHandler
Reloads THandler and optional TMiddleware modules on HMR updates.
You can either implement a custom onHmr()onHmr() method in your class by extending HmrAwareHmrAware, or if it's a plugin, override the existing onHmr()onHmr() with fully custom logic. Or, use this class's handle()handle() method inside your onHmr()onHmr() to get standard HMR handling for your modules based on the provided options you give to the constructor.
This is only useful during development.
Member visibility
Filter class members by access level.
HmrModuleHandler(
options: HmrModuleHandlerOptions<THandler, TMiddleware, TArtifacts>
)HmrModuleHandler(
options: HmrModuleHandlerOptions<THandler, TMiddleware, TArtifacts>
)Showing members with Protected visibility and higher.
Handles an HMR update event by reloading affected modules based on the event details and config. It receives an HmrUpdateEvent, then checks the type of update.
- If it's a deletion, it unloads the module. - If it's an update/creation, it checks if the file is tracked, unloads it if so, then reloads the file if it is in the handlers or middlewares directory and is a valid handler/middleware.
public async handle(event: HmrUpdateEvent): Promise<void>public async handle(event: HmrUpdateEvent): Promise<void>