voorhoede / riotjs-style-guide

Opinionated RiotJS Style Guide for teams.
Creative Commons Zero v1.0 Universal
287 stars 22 forks source link

Use lexical this outside tag scope #49

Closed MartinMuzatko closed 8 years ago

MartinMuzatko commented 8 years ago

https://github.com/voorhoede/riotjs-style-guide#assign-this-to-tag

With es6 lexical this syntax () => {} or function() {}.bind(this) it should be very easy to avoid something as redundant as var that = this or const tag = this

jbmoelker commented 8 years ago

Agree both are possible. Using const tag = this is simply our preference over function() {}.bind(this).

Also based on Angular Style Guide > var vm = this;.