boom
boom

Reputation: 11686

Let backbone views coexist or create and destroy one at a time?

I have a one-page app. A section of the layout switches between ten different views. Only one view is needed at any given time.

Is it better to let the ten views all exist and they can render and hide themselves as needed OR should the views only exists one at a time and the render/hide step also creates and destroys them?

Thanks!

Upvotes: 0

Views: 29

Answers (1)

Robert Levy
Robert Levy

Reputation: 29073

Assuming you can recreate the views fairly quickly, destroying the ones that aren't being shown will give you better performance, especially on mobile devices.

Upvotes: 1

Related Questions