• Decorator for marking a property as a child model within a Kos Data Model class.

    If a property is marked as a child model, it will be automatically included in the model's lifecycle management. This means that when the parent model will not transition to a ready state until all of its child models are ready.

    Similarly, when the parent model is destroyed, all of its child models will be destroyed as well.

    If the property is a KosModelContainer then all of the underlying child models will be included in the child model lifecycle management.

    Parameters

    • target: any

      The target object or class.

    • name: PropertyKey

      The name of the property to be marked as a child model.

    Returns any

    A decorator function that marks the property as a child model.