• Decorator for defining a Kos model effect function within a Kos Data Model class.

    Type Parameters

    • T = any

    Parameters

    • Optional props: KosModelEffectProps<T>

      An object containing configuration parameters for the topic handler.

    Returns ((target, _propertyKey, descriptor) => void)

    A decorator function.

      • (target, _propertyKey, descriptor): void
      • Parameters

        • target: T
        • _propertyKey: string
        • descriptor: PropertyDescriptor

        Returns void

    Example

    class MyKosDataModel implements IKosDataModel {
    // ...

    @kosModelEffect()
    handleModelEffect() {
    // Handle the received topic payload here.
    }
    }