Can you explain this bit here? I'm not quite following how it's working.

Also, isn't the `public/js/main` file no longer existing? Does the events module have it's own made in a similar fashion and that's why this check is needed?