(models: any[], update: any, state: any)
| 88 | |
| 89 | function takeUpdatedModel(models: T[], update: Update<T>, state: R): boolean; |
| 90 | function takeUpdatedModel(models: any[], update: any, state: any): boolean { |
| 91 | if (!(update.id in state.entities)) { |
| 92 | return false; |
| 93 | } |
| 94 | |
| 95 | const original = state.entities[update.id]; |
| 96 | const updated = Object.assign({}, original, update.changes); |
| 97 | const newKey = selectIdValue(updated, selectId); |
| 98 | |
| 99 | delete state.entities[update.id]; |
| 100 | |
| 101 | models.push(updated); |
| 102 | |
| 103 | return newKey !== update.id; |
| 104 | } |
| 105 | |
| 106 | function updateManyMutably(updates: Update<T>[], state: R): DidMutate; |
| 107 | function updateManyMutably(updates: any[], state: any): DidMutate { |
no test coverage detected