# Component Changed

In 
Published 2024-02-19

# Usage

A component has changed.

# Syntax

webClient.onComponentChanged(listener: Function);

# Arguments

Name Type Description
listener function JavaScript method executed when the API method call is completed

# Sample Javascript

const callback = (response) => {
    if (response.error) console.error(response.error);
    if (response.result)
        alert(response.result);
}
webClient.onComponentChanged(callback);

# Response

This method is asynchronous. The response is returned in an object passed to a callback method. The response object contains the following fields.

Result
Example success Response

Returns this object if the API method call was invoked successfully, false otherwise.

interface ComponentOption {
    selected?: boolean;
    objectType: string;
    recordId: string;
    recordName: string;
    checked?: boolean;
}
// Response Object
{
    result: {
        name: string;
        value: ComponentOption | null;
        timestamp: number; // Unix timestamp
    }
}