F

onModuleLoaded

Calls onLoad with the module matching filter once it initializes, without ever initializing it. A loaded module is passed at once; otherwise onLoad runs inside the module's factory, before its importer reads it. A module a full search of this Discord build found missing never loads, so onLoad never runs for it.

function onModuleLoaded(filter: MetroFilter, onLoad: (mdl: MetroExport) => void, options?: MetroModuleLoadedOptions): () => void

Parameters

NameTypeDescription
filterMetroFilter

The filter to match against.

onLoad(mdl: MetroExport) => void

Receives the matched module, once.

options?MetroModuleLoadedOptions

Whether to also match the default export (esModules) and return it on such a match (interop).

Returns

() => void

A function that stops waiting; it does nothing once onLoad has run.