Lime Web Components API Documentation - v7.4.0
    Preparing search index...

    Function SelectLimeObjects

    • Decorator that subscribes to limeobjects from the LimeObjectRepository.

      This decorator automatically updates the decorated property whenever limeobjects change in the platform. You can specify which limetype to fetch objects for, or get all objects across all limetypes. 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 limeobjects.

      Subscribes to: LimeObjectRepository

      Updates: The decorated property with limeobjects (typically Record<string, LimeObject[]>)

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

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

      class MyComponent {
      @State()
      @SelectLimeObjects()
      private allObjects: Record<string, LimeObject[]>;
      }
      import { State } from '@stencil/core';
      import { LimeObject, SelectLimeObjects } from '@limetech/lime-web-components';

      class MyComponent {
      @State()
      @SelectLimeObjects({
      limetype: 'company',
      map: [
      (objects: Record<string, LimeObject[]>) => objects['company'] ?? [],
      ],
      })
      private companies: LimeObject[];
      }