Skip to content

Instantly share code, notes, and snippets.

@beyond-code-github
Created January 12, 2014 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beyond-code-github/8385785 to your computer and use it in GitHub Desktop.
Save beyond-code-github/8385785 to your computer and use it in GitHub Desktop.
Highlighted portion of example illustrating how we deal with wholesale replacement of a complex object within an observable
if ((typeof obj == "object") && (obj !== null)) {
if (target.hasValueChanged()) {
return ko.mapping.toJS(obj);
}
return getChangesFromModel(obj);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment