* Create a copy of this node. * * @remarks * Unlike clone, a snapshot clone calculates any reactive properties * at the moment of cloning and passes the raw values to the copy. * * @param customProps - Properties to override.
(customProps: NodeState = {})
| 1227 | * @param customProps - Properties to override. |
| 1228 | */ |
| 1229 | public snapshotClone(customProps: NodeState = {}): this { |
| 1230 | const props = { |
| 1231 | ...this.getState(), |
| 1232 | ...customProps, |
| 1233 | }; |
| 1234 | |
| 1235 | if (this.children().length > 0) { |
| 1236 | props.children ??= this.children().map(child => child.snapshotClone()); |
| 1237 | } |
| 1238 | |
| 1239 | return this.instantiate(props); |
| 1240 | } |
| 1241 | |
| 1242 | /** |
| 1243 | * Create a reactive copy of this node. |
no test coverage detected