vadimdemedes / mongorito

🍹 MongoDB ODM for Node.js apps based on Redux
1.38k stars 90 forks source link

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

Open hlandao opened 7 years ago

hlandao commented 7 years ago

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

vadimdemedes commented 7 years ago

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.

zaaack commented 7 years ago

@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.

chaoyangnz commented 6 years ago

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