Is there a good way to save and restore all data for a view model, including child view models? I have a complex view that I don't want to destroy and render again, just swap out the data that is bound to it.

My solution is to create another JavaScript object and save everything off to it based on view model get calls, but this requires knowledge of what the view and it's children are doing for data; I'd prefer an automated way but I'm not seeing anything in the docs that does this.

Also, the inverse question. Is there any elegant API call for restoring all data for a view model, including it's children?

Or am I missing some other solution - can you swap out a view model on a view with a new instance dynamically?