I've got a main JS script which looks something like this..
;(function ($) {
<main javascript>
}(jQuery));
I've just created my own external library script which looks like this..
;(function ($) {
var myClass = function() {
<code>
};
}(jQuery));
What I want to do is pass my external library into the main JS script, to look something like this:
;(function ($, myClass) {
<main javascript>
}(jQuery, myClass));
However it says that myClass is undefined. How do I go about defining it?
(In terms of how I'm inserting the code it's using register/enqueue script with Wordpress. Both files are "active" so if I was to throw an alert into them both then they'd both get fired off, I'm just struggling with linking the two together so that I can use the scripts inside myClass whilst within my main JS file).
Thanks