kentcdodds / es6-todomvc

The vanillajs example converted to es6
https://kcd.im/webpack-workshop-repo
MIT License
351 stars 358 forks source link

Arrow functions for lexical this #25

Closed domfarolino closed 7 years ago

domfarolino commented 7 years ago

Just briefly looking at some of the code in this repository I see the pattern var that = this; in a lot of places. If I'm not mistaken this can be eliminated with the use of ES6 arrow functions as they support lexical this right? If so, I'd be willing to work on a PR if that is something that would be considered.


One such example: https://github.com/kentcdodds/es6-todomvc/blob/master/src/view.js#L63 that could be made more "ES6"-like

kentcdodds commented 7 years ago

Thanks for pointing it out, but the code itself is less important than configuring the tools which is why I didn't spend much time with migrating code to ES6. Under normal circumstances, I'd happily accept a pull request, but due to the difficulties propogating changes through the various branches, I'd prefer to only make changes when they're absolutely necessary.

domfarolino commented 7 years ago

No problem. Yeah I didn't see the plethora of branches in this repo haha, that would be tough.