Will rendering multiple views in Backbone happen synchronous or asynchronous?

177 views Asked by At

Let me start by saying this is a theoretical question thus I cannot provide you with any code.

I'm thinking about a Backbone structure where multiple views get rendered on one page. Every view contains a render function with one or more API calls which have responsetimes that can be fast or slow.

I'm wondering if we have view order A, B, C, D and A's data is responding slowly from the server, will this block the rendering/data retrieval of B, C and D when I loop through those views to render, or will it initialize the render function of A don't care about it and initialize the render function B?

I tried to write this as clearly as possible but if you have any questions just ask.

UPDATE: Some time passed and I found a way to link these all together. I worked with a jQuery deferred and used the pipe method to pipe these deferreds together. Source: https://api.jquery.com/deferred.pipe/

1

There are 1 answers

0
webdev_be On

I tested this by setting up a JSFiddle and found out that Backbone doesn't care about loading slow requests. It just renders another view if that's called. For anyone's information

Pull in external resources
Build two views where one has a call to a large data end point