Closed tempelmann closed 9 years ago
Cool, thanks!
We need to focus on the async flow readability a bit. Generally, we have these instruments:
this
func.bind(stuff)
func
this == stuff
Promise
Let me refactor the current solution using proper binding (without explicit closures) first; I will consider adding Promises later.
Refactored explicit us to .bind(this) in https://github.com/ondras/wwwsqldesigner/commit/9ff7bfe0ff62fa43beb590cb37c836f4e77f2ce9.
us
.bind(this)
Cool, thanks!
We need to focus on the async flow readability a bit. Generally, we have these instruments:
this
is specified during runtime based on how the method gets called. Anything executed as a callback will have incorrectthis
.func.bind(stuff)
will create a bound version offunc
that will always havethis == stuff
(independently on howfunc
gets called)Promise
polyfill for older browsers, though.Let me refactor the current solution using proper binding (without explicit closures) first; I will consider adding Promises later.