Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cloning an Observe instance, by calling clone() on it, copies its properties (optionally deep-cloning nested Observes) to a new object that's an instance of the class's Clone child class. The original Observe's prototype is available in the clone object's prototype chain, in addition to the merge() function, which pushes any changes back to the original object and effectively destroys the clone copy.
Additionally, saving a Clone of a can.Model functions much like a merge() with a round-trip to the AJAX endpoint.
Example use:
make a clone of a page model to populate an Edit form. The original display of the model data is unchanged while pushing form data into the clone copy. When the form is saved by calling save() on the clone model, the original model and any of its live-bound views are updated.