( targets: Array<T>, )
| 1128 | * @returns An object containing the array of proxies and a function to get all changes |
| 1129 | */ |
| 1130 | export function createArrayChangeProxy<T extends object>( |
| 1131 | targets: Array<T>, |
| 1132 | ): { |
| 1133 | proxies: Array<T> |
| 1134 | getChanges: () => Array<Record<string | symbol, unknown>> |
| 1135 | } { |
| 1136 | const proxiesWithChanges = targets.map((target) => createChangeProxy(target)) |
| 1137 | |
| 1138 | return { |
| 1139 | proxies: proxiesWithChanges.map((p) => p.proxy), |
| 1140 | getChanges: () => proxiesWithChanges.map((p) => p.getChanges()), |
| 1141 | } |
| 1142 | } |
| 1143 | |
| 1144 | /** |
| 1145 | * Creates a proxy for an object, passes it to a callback function, |
no test coverage detected
searching dependent graphs…