Compares the current screen states with the previous screen states and triggers actions based on changes.
The options for comparing screen states.
Whether to restart the comparison process.
The parameters for the comparison.
Function to get updated parameters.
The type of display being recorded.
Whether the recording is optimized for video.
The current screen states.
The previous screen states.
The active names in the current context.
Function to trigger actions based on changes.
A promise that resolves when the comparison and any triggered actions are complete.
Will log an error message if an error occurs during the comparison process.
const options = { restart: false, parameters: { getUpdatedAllParams: () => { /* Logic to get updated parameters */ }, recordingDisplayType: 'video', recordingVideoOptimized: true, screenStates: [{ state: 'active' }, { state: 'inactive' }], prevScreenStates: [{ state: 'inactive' }, { state: 'active' }], activeNames: ['Alice', 'Bob'], trigger: async (data) => { /* Logic to handle the trigger */ }, },};await compareScreenStatesService.compareScreenStates(options);// If any screen state has changed, the trigger function will be called accordingly. Copy
const options = { restart: false, parameters: { getUpdatedAllParams: () => { /* Logic to get updated parameters */ }, recordingDisplayType: 'video', recordingVideoOptimized: true, screenStates: [{ state: 'active' }, { state: 'inactive' }], prevScreenStates: [{ state: 'inactive' }, { state: 'active' }], activeNames: ['Alice', 'Bob'], trigger: async (data) => { /* Logic to handle the trigger */ }, },};await compareScreenStatesService.compareScreenStates(options);// If any screen state has changed, the trigger function will be called accordingly.
Compares the current screen states with the previous screen states and triggers actions based on changes.
Param: options
The options for comparing screen states.
Param: options.restart
Whether to restart the comparison process.
Param: options.parameters
The parameters for the comparison.
Param: options.parameters.getUpdatedAllParams
Function to get updated parameters.
Param: options.parameters.recordingDisplayType
The type of display being recorded.
Param: options.parameters.recordingVideoOptimized
Whether the recording is optimized for video.
Param: options.parameters.screenStates
The current screen states.
Param: options.parameters.prevScreenStates
The previous screen states.
Param: options.parameters.activeNames
The active names in the current context.
Param: options.parameters.trigger
Function to trigger actions based on changes.
Returns
A promise that resolves when the comparison and any triggered actions are complete.
Throws
Will log an error message if an error occurs during the comparison process.
Example