To self = this || bind(the things)? #329

Closed
rwaldron opened this Issue Sep 10, 2012 · 4 comments

3 participants

@rwaldron

Noticed here there is var self = this, but elsewhere there is fn.bind(scope); I wonder if it would be worthwhile to standardize on fn.bind(scope) across all the code?

@addyosmani
Yeoman member

+1 to standardize on fn.bind(scope).

@sindresorhus
Yeoman member

My only concern is when there's a lot of inner methods, but if that's the case it might need some refactoring anyway.

@rwaldron

@sindresorhus hm, maybe elsewhere? In this particular example, there is only one level of nested function expression definitions. I definitely feel ya though, in certain cases in the Johnny-Five codebase, I have 2 levels of nested FEs and it can look a little boilerplate heavy.

@sindresorhus
Yeoman member

Yes, elsewhere, but I love consistency, so lets go for it.

@addyosmani addyosmani pushed a commit that closed this issue Sep 11, 2012
@rwaldron rwaldron Standardize on fn.bind(this). Fixes gh-329
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
daaab6e
@rwaldron rwaldron added a commit to rwaldron/yeoman that referenced this issue Sep 11, 2012
@rwaldron rwaldron Use |thisArg| instead of ths = this; Fixes gh-329 eee8351
@szinya szinya pushed a commit to menthainternet/yeoman that referenced this issue Sep 17, 2014
@rwaldron rwaldron Standardize on fn.bind(this). Fixes gh-329
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
7208d41
@szinya szinya pushed a commit to menthainternet/yeoman that referenced this issue Sep 17, 2014
@rwaldron rwaldron Use |thisArg| instead of ths = this; Fixes gh-329 eb0125d
@addyosmani addyosmani pushed a commit that referenced this issue Apr 24, 2015
@rwaldron rwaldron Standardize on fn.bind(this). Fixes gh-329
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
17b92d2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment