GeoLeaf Core API - v3.19.0
    Preparing search index...

    Options of IModuleRegistry.init().

    interface ModuleInitOptions {
        onModuleError?: (failure: ModuleInitFailure) => "abort" | "continue";
        shouldContinue?: () => boolean;
    }
    Index
    onModuleError?: (failure: ModuleInitFailure) => "abort" | "continue"

    Decides what a module whose init() fails does to the rest of the initialisation.

    "continue" isolates the failure: the modules that depend on it are not initialised, getActiveModules() lists neither them nor the failed module, destroy() never calls a module that did not run — the failed one is still torn down, its init() may have run in part — and every other module is initialised. "abort" rejects init() with the module's error, which is also what happens without this option.

    Type Declaration

      • (failure: ModuleInitFailure): "abort" | "continue"
      • Parameters

        • failure: ModuleInitFailure

          The module that failed, and the modules that depend on it.

        Returns "abort" | "continue"

        "continue" or "abort".

    shouldContinue?: () => boolean

    Asked before each module's init(): false stops the initialisation there, and the modules not reached yet never start. init() then resolves without an error.

    This is how a caller ends a run it no longer wants — an application unmounted while it was starting. destroy() is refused while init() runs; the caller stops it with this, waits for init() to settle, then destroys: only the modules that started are torn down.

    Type Declaration

      • (): boolean
      • Returns boolean

        true to go on, false to stop before the next module.