mongorito icon indicating copy to clipboard operation
mongorito copied to clipboard

Is it possible to extend methods with static ES6 class methods ?

Open hlandao opened this issue 7 years ago • 3 comments

It is not clear from docs and will work in theory. Are there any consequences I should worry about ?

hlandao avatar Jun 06 '17 09:06 hlandao

Could you explain what's troubling to understand in this example, so that I could improve it? https://github.com/vadimdemedes/mongorito#extending-model-with-new-methods

As soon as you don't overwrite native methods, I don't think there are any bad consequences.

vadimdemedes avatar Jun 07 '17 05:06 vadimdemedes

@vadimdemedes I think the point is the plugin usage in docs doesn't show the truly power of plugin, since we can easily extend model method and static method with ES6 class inherit.

zaaack avatar Jun 07 '17 06:06 zaaack

+1 the same confusion. What are things plugins can do but inherited class cannot do?

chaoyangnz avatar Nov 26 '17 08:11 chaoyangnz