meteor-space / base

Foundation for Modular Application Architecture in Meteor.
MIT License
75 stars 5 forks source link

Add helpers for working with super classes / methods in Space.Object #69

Closed DominikGuzei closed 8 years ago

DominikGuzei commented 8 years ago

Currently it's a bit of pain to call the super class / methods which should always be done (especially when the super method is coming from the framework).

So let's add a simple api like Space.Object::superClass() and Space.Object::superMethod('myMethod') so that you can say do something like:

Space.Object.extend('MySubClass', {
  onDependenciesReady() {
    this.superMethod('onDependenciesReady').call(this);
  },
  otherMethod() {
    return this.superClass().STATIC_PROPERTY;
  }
});