In the last video, I said that Typescript doesn't have a final keyword that can make sure that a given property does not get changed.
That was a mistake on my part.
Typescript does have a keyword of readonly. It prevents a property of a class from being changed. You can read more about readonly here: https://www.typescriptlang.org/docs/handbook/classes.html#readonly-modifier
With this in mind, we can update the TicketCreatedListener class to the following:
export class TicketCreatedListener extends Listener<TicketCreatedEvent> {
readonly subject = Subjects.TicketCreated;
// ...everything else
}This change can be made in all other listeners that we create in this course.
Credit for this fix goes to Sergio Municio (https://www.udemy.com/course/microservices-with-node-js-and-react/learn/#questions/11049788/ )