Executes actions when an event is emitted on an object.