Skip to main content

Module

Callable


  • A @Module is a class decorator to be placed on top of a class that represents a module.

    • A Module class must implement the IModule interface.
    • A Module class constructor is injected with the outputs of the modules it imports.
    • The IModule.onInit method is called to initialize the module, and is where you will define your infrastructure.
    @example
    @Module({
    args: [{ isArg: (app: App) => app instanceof App, name: 'app' }],
    imports: [OtherModule],
    postModelActionHooks: [{ ACTION_NAME: 'SomeAction', collectInput: () => { ... }, handle: () => { ... } }],
    })
    export class MyModule implements IModule<Region> {
    constructor(app: App) { ... }

    async onInit(): Promise<Region> { ... }
    }
    @see

    Definition of Modules.


    Parameters

    Returns (constructor: any) => void

    The decorated class.

      • (constructor: any): void
      • Parameters

        • constructor: any

        Returns void