Class CompareActiveNames

Compares the current active names with the previous active names and triggers an action if there are changes.

The options for comparing active names.

Whether to restart the comparison.

The parameters for the comparison.

Function to get updated parameters.

The current active names.

The previous active names.

Function to update the previous active names.

Function to trigger an action when names change.

A promise that resolves when the comparison is complete.

Will log an error message if an error occurs during the comparison.

const options = {
restart: false,
parameters: {
getUpdatedAllParams: () => { /* Logic to get updated parameters */ },
activeNames: ['Alice', 'Bob'],
prevActiveNames: ['Alice', 'Charlie'],
updatePrevActiveNames: (names) => { /* Logic to update previous active names */ },
trigger: async (data) => { /* Logic to handle the trigger */ },
},
};

await compareActiveNamesService.compareActiveNames(options);
// If 'Bob' is not in the previous active names, it will trigger the action.

Constructors

Methods

Constructors

Methods

  • Compares the current active names with the previous active names and triggers an action if there are changes.

    Parameters

    Returns Promise<void>

    A promise that resolves when the comparison is complete.

    Will log an error message if an error occurs during the comparison.