gradum-kit - v0.1.0
    Preparing search index...

    Class GradumHandler<ModelType>

    GradumHandler

    Holds model-level logic that would otherwise crowd the model itself. A handler sees only this.model — no element and no view — so use it for computations and edits over the model's data, and reach for a GradumOperator when the DOM is involved. Register one with the @handler decorator.

    Type Parameters

    Index
    • Type Parameters

      • ModelType extends GradumModel<any, any, any, any, any> = GradumModel<any, any, any, any, any>

        The element's MVC model type.

      Parameters

      • Optionalmodel: ModelType

        The model to bind. Omit it to let the MVC wiring bind one on registration.

      Returns GradumHandler<ModelType>

      Create a handler. Handlers are normally constructed without arguments — the MVC wiring binds GradumHandler.model when the handler is registered on its model.

    keyName: string

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

    model: ModelType

    The model this handler operates on. Assigned by the MVC wiring when the handler is registered, so it is set by the time initialize runs.

    • Protected Function

      setup

      Returns void

      Called in the constructor. Use for setup that should happen at instantiation, before this.initialize() is called.