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?
var self = this
+1 to standardize on fn.bind(scope).
My only concern is when there's a lot of inner methods, but if that's the case it might need some refactoring anyway.
@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.
Yes, elsewhere, but I love consistency, so lets go for it.
Standardize on fn.bind(this). Fixes gh-329
Signed-off-by: Rick Waldron <email@example.com>
Use |thisArg| instead of ths = this; Fixes gh-329