Lime Web Components API Documentation - v7.4.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.

      import { State } from '@stencil/core';
      import { SelectApplicationName } from '@limetech/lime-web-components';

      class MyComponent {
      @State()
      @SelectApplicationName()
      private appName: string;
      }
      import { State } from '@stencil/core';
      import { SelectApplicationName } from '@limetech/lime-web-components';

      class MyComponent {
      @State()
      @SelectApplicationName({
      map: [(name) => name?.toUpperCase()],
      })
      private appNameUppercase: string;
      }
      import { State } from '@stencil/core';
      import { SelectApplicationName } from '@limetech/lime-web-components';

      class MyComponent {
      @State()
      @SelectApplicationName({
      filter: [(name) => name !== null && name !== undefined],
      })
      private validAppName: string;
      }
      import { State } from '@stencil/core';
      import { SelectApplicationName } from '@limetech/lime-web-components';

      class MyComponent {
      @State()
      @SelectApplicationName({
      map: [(name) => name?.toLowerCase(), (name) => `${name} CRM`],
      filter: [(brandedName) => brandedName.length > 4],
      })
      private brandedName: string;
      }