peerlibrary / meteor-blaze-components

Reusable components for Blaze
http://components.meteorapp.com/
BSD 3-Clause "New" or "Revised" License
354 stars 26 forks source link

Correcting a syntactic error in ES6 class usage in readme #89

Closed amirmohsen closed 9 years ago

amirmohsen commented 9 years ago

I don't think this bit in the readme file is valid ES6. If you want to use classes to create namespaces, it has to be done via assignment.

The preferred way of doing namespaces are through using the new module system. Unfortunately, Meteor hasn't integrated ES6 modules yet so we are stuck with this method for now.

mitar commented 9 years ago

Thanks!

Hm, are there anonymous classes possible in ES6? So Buttons.Red = class extends BlazeComponent {}?

amirmohsen commented 9 years ago

Yeah, it should be possible. Checkout this MDN article with more details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/class ES6 classes are just syntactic sugar for prototypical inheritance so in essence, there's nothing new here.

mitar commented 9 years ago

Yea, but probably stack then looks uglier.