Lime Web Components API Documentation - v6.24.0
    Preparing search index...

    Function SelectApplicationName

    • 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.

      Parameters

      Returns PropertyDecorator

      A PropertyDecorator that sets up automatic subscription to application name

      Subscribes to: ApplicationRepository

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

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

      @State()
      @SelectApplicationName()
      private appName: string;
      // Transform the application name
      @State()
      @SelectApplicationName({
      map: [(name) => name?.toUpperCase()]
      })
      private appNameUppercase: string;
      // Only update when name is defined
      @State()
      @SelectApplicationName({
      filter: [(name) => name !== null && name !== undefined]
      })
      private validAppName: string;
      // Combine map and filter for complex transformations
      @State()
      @SelectApplicationName({
      map: [
      (name) => name?.toLowerCase(),
      (name) => `${name} CRM`
      ],
      filter: [(formattedName) => formattedName?.length > 4]
      })
      private brandedName: string;