-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue/2758 Added deepClone API (v5.7.0) #2759
Conversation
Co-Authored-By: tomgreenfield <tomgreenfield@users.noreply.github.com>
Co-Authored-By: tomgreenfield <tomgreenfield@users.noreply.github.com>
Co-Authored-By: tomgreenfield <tomgreenfield@users.noreply.github.com>
Co-Authored-By: tomgreenfield <tomgreenfield@users.noreply.github.com>
Co-Authored-By: tomgreenfield <tomgreenfield@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code 👓
* Removed `set` and `setOnChildren` parameters for the `modifier` function only * Allowed the `modifier` function to specify custom unique ids or default to assign unique ids automatically * Switched the `modifier` function arguments so that the `cloned` model appears before the original, as its more useful that way * Swapped the new unique id so that the original id is the prefix rather than the postfix, which will allow easier reading of cloned items in the dom and model collections
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small suggestion, otherwise looks good
#2758
Added
AdaptModel.deepClone
to clone model hierarchiesChanged
Adapt.findById
Moved indexing to add/remove events in data collection rather than indexing after file downloadAdaptModel.setupModel
Stopped running on the adapt:initialize event but instead is called after cloned or on instantiation after file downloadQuestionModel
torestoreUserAnswers
after clone without having to listen to theadapt:initialize
eventinit
execution inItemsQuestionModel
such thatItemsComponentModel
can setup its children beforeQuestionModel
tries torestoreUserAnswers