rendrjs / rendr

Render your Backbone.js apps on the client and the server, using Node.js.
MIT License
4.09k stars 312 forks source link

add ability to pass fetch_options for a lazy fetch #466

Closed sarchila closed 9 years ago

sarchila commented 9 years ago

This PR introduces the ability to use the option fetch_options when lazy-loading a view to pass options to the .fetch call.

Additionally, I noticed that the options that the fetch method sets by default (specifically readFromCache and writeToCache) are not being added to the model's options hash because the options provided are not being passed down to the getModelOrCollectionForSpec call. I made the change here to pass those options along as well.

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-0.19%) to 84.03% when pulling f0681a81c9fab5646ca492e63a02fa74939160a7 on sarchila:SA-lazyfetch-pass-options into 5ada76ac4d284008e966037c7e0d86b83190f326 on rendrjs:master.

purusho commented 9 years ago

:+1:

bigethan commented 9 years ago

Nice improvement, we've run into the same issues with our lazy views

ingiulio commented 9 years ago

:+1:

saponifi3d commented 9 years ago

@sarchila - looks good, can you add some tests around this?

Thanks!