(
keys: { [id: string]: any },
update: Update<T>,
state: any
)
| 127 | state: R |
| 128 | ): void; |
| 129 | function takeNewKey( |
| 130 | keys: { [id: string]: any }, |
| 131 | update: Update<T>, |
| 132 | state: any |
| 133 | ): boolean { |
| 134 | const original = state.entities[update.id]; |
| 135 | const updated: T = Object.assign({}, original, update.changes); |
| 136 | const newKey = selectIdValue(updated, selectId); |
| 137 | const hasNewKey = newKey !== update.id; |
| 138 | |
| 139 | if (hasNewKey) { |
| 140 | keys[update.id] = newKey; |
| 141 | delete state.entities[update.id]; |
| 142 | } |
| 143 | |
| 144 | state.entities[newKey] = updated; |
| 145 | |
| 146 | return hasNewKey; |
| 147 | } |
| 148 | |
| 149 | function updateOneMutably(update: Update<T>, state: R): DidMutate; |
| 150 | function updateOneMutably(update: any, state: any): DidMutate { |
no test coverage detected