Now I'm commenting on both on interface class and implemented class. But sometimes, I feel it's unnecessary commenting both. So I want to hear from Pros which is a better way? commenting on both? or only on interface class?
Example)
/**
* Google Analytics service interface
*/
interface IGoogleAnalyticsService {
/**
* Track an event
*
* @param { string } category category-name
* @param { string } action action-name
* @param { string } label
* @param { number } value
*/
trackEvent(category: string, action: string, label?: string, value?: number): void;
}
/**
* Google Analytics service
*/
class GoogleAnalyticsService implements IGoogleAnalyticsService {
/**
* Track an event
*
* @param { string } category category-name
* @param { string } action action-name
* @param { string } label
* @param { number } value
*/
trackEvent(category: string, action: string, label: string = null, value: number = null) {
this.$window.ga.trackEvent(category, action, label, value);
}
}