tc39 / proposal-class-fields

Orthogonally-informed combination of public and private fields proposals
https://arai-a.github.io/ecma262-compare/?pr=1668
1.72k stars 113 forks source link

Update example with class field method #160

Closed everdimension closed 5 years ago

everdimension commented 6 years ago

It seems to me that using class fields for declaring instance methods is one of the core reasons for creating this proposal. It should be helpful to see example usage in README.

It also shows how you can no longer need the constructor and arguably make code more concise.

littledan commented 6 years ago

Can't merge this due to @jridgewell's comments.

everdimension commented 6 years ago

@littledan Sure, I open to comments and changes.

If my proposed changes are not "correct" in some way, then I believe this only strengthens the idea that using functions as class fields should be better documented in this proposal.

I would surely like to better understand how they are supposed to work.

littledan commented 6 years ago

I agree that documentation should be improved in this proposal. I wonder if, rather than editing the original example, it could be helpful to have an additional document about details off to the side.

littledan commented 5 years ago

Closing this PR due to issues noted months ago.