Function liveStateConfig

  • This decorator, introduced in version 0.8.0, adds the ability to have live state config properties be contributed by the element instance. They will override values from the liveState decorator on the class, if used.

    Example:

    @customElement('join-params')
    @liveState({topic: 'join_params', properties: ['result']})
    export class JoinParamsElement extends LitElement {

    @property({attribute: 'the-url'})
    @liveStateConfig('url')
    theUrl: string = "foo";

    @property({attribute: 'api-key'})
    @liveStateConfig('params.api_key')
    apiKey: string = '';

    This will cause the the-url attribute of the element to be used as the url to connect to, and the api-key attribute to be passed as an api_key parameter to the channel join.

    Parameters

    • configProperty: any

    Returns ((proto: any, propertyName: any) => void)

      • (proto: any, propertyName: any): void
      • Parameters

        • proto: any
        • propertyName: any

        Returns void

Generated using TypeDoc