I think setState should always set everything (even if values are empty). That way we always have a consistent view of the state.

I’ll get around to reviewing this sometime this afternoon.  

--  
Steve Nguyen
Drexel University - Computer Science
st.nguyen09@gmail.com
(484) 602-5138


On Saturday, March 8, 2014 at 12:07 PM, seanblue wrote:

> In Source/models/ProjectViewModel.js:
> > @@ -135,8 +144,55 @@ define([ > }; > }; > > - ProjectViewModel.prototype.setState = function(state) { > - // TODO > + ProjectViewModel.prototype.setState = function(state, availableWidgets) { > + this._name = state.name (http://state.name); > + this._workspace = new WorkspaceViewModel(state.workspace); > + this._googleAnalytics = new GoogleAnalytics(state.analytics); > + > + this._components = $.map(state.components, function(itemState) {  
> Should I add if(defined(state.blahblah)) around all of these? It depends on whether we expect setState to always set everything or if it can set partial state.
> For anything that goes through the constructor (load and new project), the defaults map ensures that everything is there.  
>  
> —
> Reply to this email directly or view it on GitHub (https://github.com/KSHSK/WAVED/pull/121/files#r10409845).
>  
>  
>