Observable for changes of context.
Front.contextUpdates.subscribe(context => {
switch(context.type) {
case 'noConversation':
console.log('No conversation selected');
break;
case 'singleConversation':
console.log('Selected conversation:', context.conversation);
break;
case 'multiConversations':
console.log('Multiple conversations selected', context.conversations);
break;
default:
console.error(`Unsupported context type: ${context.type}`);
break;
}
});
Your plugin will receive a new Context every time one of its properties changes.
As an example, if the assignee of the selected conversation changes, a new context will be sent to the plugin to reflect this change.