Single Bind Statement For Entire Page

47 views Asked by At

Using RivetsJS is there any reason (performance wise) why it would be a bad idea to bind an entire presentation model to the <body> tag as opposed to bind individual objects to individual elements?

Something like this:

Model = {}
rivets.bind($('body').get(), {model: Model})

$.ajax({...success: function(response){Model.selectedUser = response}})

Just seems like it would make life easier and keep the presentation model bound to the view at all times.

0

There are 0 answers