Skip to content

Function: createHotHeader() ​

ts
function createHotHeader(moduleId: string): string;

Defined in: src/wirestate-dev/transform/hot-transform.ts:23

Builds the statement prepended to a module declaring injectable classes.

Parameters ​

ParameterTypeDescription
moduleIdstringStable module identifier, usually the root-relative path.

Returns ​

string

JavaScript statement, without a trailing newline.

Remarks ​

The statement opens the module in the Wirestate hot runtime, so @Injectable() attributes every class decorated while the body evaluates to this module id. It uses the namespace import declared by createHotFooter: import bindings are initialized before any module statement runs, so the order in source is free. It ends without a line break to keep the original line numbers intact.