SteveSanderson/knockout — pull request #597 by farmdawgnation (2012-08-07 20:56:58+00:00)
Title: Unwrap observables for event handlers.

Hello again friends,

So, I don't know if there's a *preferred* solution for this or not, but it's something that we've found particularly frustrating in working with at OpenStudy, but not frustrating enough to actually look into in-depth. Anyway, today we decided it was probably time to stop procrastinating and dig into what's actually going on.

What we found is that the event binding handler expected you to pass in just a function, and didn't allow you the possibility to pass in an observable containing a function. If you did pass in such an observable, it would merely run the observable instead of the containing function, which doesn't yield any errors.

We figured it would make sense to make the binding handler intelligent enough to unwrap an observable if it finds one, so we implemented it and have presented it to you in this nice, neat pull request.

Let me know if you have any questions.