turbodombuilder - v0.9.22
    Preparing search index...

    Class TurboController<ElementType, ViewType, ModelType, EmitterType>

    TurboController

    The MVC base controller class. Its main job is to handle some part of (or all of) the logic of the component. It has access to the element, the model to read and write data, the view to update the UI, and the emitter to listen for changes in the model or any other internal events. It can only communicate with other controllers via the emitter (by firing or listening for changes on a certain key).

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    • Type Parameters

      • ElementType extends object = object
      • ViewType extends TurboView<
            object,
            TurboModel<
                any,
                any,
                any,
                "map"
                | "array",
                TurboDataBlock<any, any, any, any, any>,
            >,
            TurboEmitter<
                TurboModel<
                    any,
                    any,
                    any,
                    "map"
                    | "array",
                    TurboDataBlock<any, any, any, any, any>,
                >,
            >,
        > = TurboView<
            any,
            any,
            TurboEmitter<
                TurboModel<
                    any,
                    any,
                    any,
                    "map"
                    | "array",
                    TurboDataBlock<any, any, any, any, any>,
                >,
            >,
        >
      • ModelType extends TurboModel<
            any,
            any,
            any,
            "map"
            | "array",
            TurboDataBlock<any, any, any, any, any>,
        > = TurboModel<
            any,
            any,
            any,
            "map"
            | "array",
            TurboDataBlock<any, any, any, any, any>,
        >
      • EmitterType extends TurboEmitter<
            TurboModel<
                any,
                any,
                any,
                "map"
                | "array",
                TurboDataBlock<any, any, any, any, any>,
            >,
        > = TurboEmitter<
            TurboModel<
                any,
                any,
                any,
                "map"
                | "array",
                TurboDataBlock<any, any, any, any, any>,
            >,
        >

      Returns TurboController<ElementType, ViewType, ModelType, EmitterType>

    Properties

    keyName: string

    The key of the controller. Used to retrieve it in the main component. If not set, if the element's class name is MyElement and the controller's class name is MyElementSomethingController, the key would default to "something".

    element: ElementType

    The element it is bound to.

    view: ViewType

    The MVC view.

    model: ModelType

    The MVC model.

    emitter: EmitterType

    The MVC emitter.

    Methods

    • Function

      initialize

      Returns void

      Initializes the controller. Specifically, it will set up the change callbacks.

    • Protected Function

      setupChangedCallbacks

      Returns void

      Setup method intended to initialize change listeners and callbacks.