The idea behind partial classes is that you can group certain functions together. The best example of this in C# is putting control definitions in one file and the event han
Redefine the type through inheritance approach like this:
var Dog = Class.extend({
init:function(data){
data = data || {};
this.name = data.name;
},
run:function(){
/*impl*/
}
});
/*other js file that require first file */
var Dog = Dog.extend({
init:function(data){
this._super(data);
},
bark:function(){
return 'woof';
}
});
The only problem in this approach is the dependency management, but it works.
obs: using John Resing class.js, but could be written in typescript, ES6, AngularJs, ... and many other libraries.