backbone.js - Re-rendering a view in backbone Marionette: best practice -


this simple question.

basically case:

var newviewinstance1 = new myview(); mylayout.myregion.show(newviewinstance1) 

now, later, want show view (which static one) again in same layout region . there may or may not have been different view in region in meantime.

is there difference between these two:

mylayout.myregion.show(newviewinstance1) //again  //or var newviewinstance2 = new myview(); mylayout.myregion.show(newviewinstance2) 

if latter, example, newviewinstance1 left hanging around?

thanks

--justin wyllie

there's no real difference beyond view initalization (e.g. if you're fetching or computing information in view's initialize function).

in case, when region shows view, closes open views in region. so, no: newviewinstance1 won't left hanging around in second case.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -