• Decorator that subscribes to the application name from the ApplicationRepository.

    This decorator automatically updates the decorated property whenever the application name changes in the platform. It's the recommended approach over manual subscriptions as it handles subscription lifecycle automatically.

    Returns

    A PropertyDecorator that sets up automatic subscription to application name

    Remarks

    Subscribes to: ApplicationRepository

    Updates: The decorated property with the application name (string)

    Lifecycle: Automatically subscribes in connectedCallback and unsubscribes in disconnectedCallback of the component.

    Example

    @State()
    @SelectApplicationName()
    private appName: string;

    Example

    // Transform the application name
    @State()
    @SelectApplicationName({
    map: [(name) => name?.toUpperCase()]
    })
    private appNameUppercase: string;

    Example

    // Only update when name is defined
    @State()
    @SelectApplicationName({
    filter: [(name) => name !== null && name !== undefined]
    })
    private validAppName: string;

    Example

    // Combine map and filter for complex transformations
    @State()
    @SelectApplicationName({
    map: [
    (name) => name?.toLowerCase(),
    (name) => `${name} CRM`
    ],
    filter: [(formattedName) => formattedName?.length > 4]
    })
    private brandedName: string;

    Parameters

    Returns PropertyDecorator