@ejay-ibm I’m not sure which modules you checked out, but there are a lot of modules listening on notifications from other modules.
Basically the elements you need are:
- a module variable that stores the image name
this.image = 'talking.gif'
- a notification handler that changes the current image
notificationReceived(notification, payload) {
if (notification === 'SOME NOTIFICATION') {
this.image = 'looking.gif';
}
}
- a render function that displays the image
getDom() {
const wrapper = document.createElement('div');
const image = document.createElement('img');
image.src = 'somepath' + this.image;
wrapper.appendChild(image);
return wrapper;
}
I think this should give you an idea how to solve it
