4 ms·
I have an application with a big data structure built as a tree of objects. With deep cloning I can: - Provide undo/redo. I just clone the whole tree. - Load/Sa
by giankam 3y ago
I have an application with a big data structure built as a tree of objects. With deep cloning I can:
- Provide undo/redo. I just clone the whole tree.
- Load/Save from/to the database part of the tree. I load it in a separate object and then deep clone in place.
- Do mass modifications to a part of the tree. A clone a copy, apply modifications and the clone back in place.
I could do some of the changes in place, but to optimize Vue reactivity I work on copies.
I use prototypes so only lodash works for me.