Of course I had to put it to the test and so here’s the proverbial ToDoList with ViewModel in a live environment that you can modify and play with. Here’s the source code if you want to see how it works with Meteor. And also an article explaining the code.
@arggh wrote a post with his experience. It’s about the Blaze version but the same can be said about the React one. As he mentions, it’s hard to see the value of VM at first glance because you have to actually try it to see that it really cuts down your code and simplifies it a lot. Not because it has syntactic sugar, but because it’s a much simpler paradigm and it’s designed with developer happiness in mind.
I was hoping you would come up with a solution without autorun I have over 600 components in my app. Most of them use ViewModel. The funny thing is, out of all of them, the most trouble I had was the checkbox-component (utilizing a checkbox input, not just div with click bindings)!
I am not sure if I was trying to allow too many different ways to use it, thus making a simple thing complex, or if there’s something quirky about using VM bindings with checkbox. Especially when making a reusable component.
edit: by quirky, I mean not well-suited for the flow of events & actions