Closed disruptek closed 9 years ago
Just woke up and it came to me like a lightning bolt. :-)
What we're doing here is using the attribute to deduce the context. If the value looks like an object, we presume that the contents represent multiple attributes on the context and we set them. Otherwise, we simply assign the value to the same attribute referenced by the setBinding
call. It's a tricky bit of overloading that really should be documented better. Let me know if you want me to take a crack at it.
LOL, "a tricky bit of overloading" pretty much sums up the entire Epoxy library. Binding magic definitely relies on dirty tricks. Sure, if you'd like to take a crack and better documentation, go for it.
Consider the following:
https://github.com/gmac/backbone.epoxy/blob/master/backbone.epoxy.js#L1189-1197
I can't see any reason not to perform this object wrap in every case. What am I missing?