Is there a way to sub-class or extend can.components in canjs?
Basically, I want to have sort of a base class for my can.components. The base class would listen to an observable, and call custom methods on itself whenever the observable has changed.
These custom methods would only be implemented in sub-components.
Problem: after having defined baseComponent.events { ... }, I want to extend it in the sub-components.
BaseComponent.events would contain a "dispatch" function that would call the appropriate sub-component functions, e.g. when the observable changes state, and state is "X", call functionX. When state is "Y", call functionY.
functionX & functionY are implemented in subComponent1, subComponent2, etc...