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; onMissing runs instead.

function onModuleLoaded(filter: MetroFilter, onLoad: (mdl: MetroExport) => void, waitOptions?: MetroWaitOptions): () => void

Parameters

NameTypeDescription
filterMetroFilter

The filter to match against.

onLoad(mdl: MetroExport) => void

Receives the matched module, once.

waitOptions?MetroWaitOptions

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

Returns

() => void

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