compareActiveNames

Compares the current activeNames list with the prevActiveNames list and triggers an action if there are any differences.

This function performs the following steps:

  1. If the restart flag is true, it triggers the action without comparison

  2. If restart is false, it compares each name in activeNames to check if any name is new or removed compared to prevActiveNames

  3. If a change is detected, it calls the trigger function with the updated activeNames

  4. Finally, it updates prevActiveNames to reflect the current activeNames

Parameters

options

The options containing restart flag and parameters

Example:

val options = CompareActiveNamesOptions(
restart = false,
parameters = object : CompareActiveNamesParameters {
override val activeNames = listOf("Alice", "Bob")
override val prevActiveNames = listOf("Alice")
// ... other required implementations
}
)

compareActiveNames(options)