I have a big client-side javascript class defined for an application. I want to break this class into multiple files so people can work on the class separately and not interrupt each other. My class is called OC and I declared it like the following in a file called oc.js:
function OC(config) {
// omitted for brevity
}
this class has many members and variables inside it. Now I'm willing to separate little bits of this file into two new files. So I created oc.connection.draw.js like the following:
OC.prototype = {
_drawConnections: function (links) { omitted for brevity }
}
first of all, It seems I don't have access to arguments of my main function (config) in the prototype. Is it any work around for that except creating a local variable for it? secondly is there any best practice for this in javascript community? My ideal result would be something like partial classes in .net framework.