(updates: any[], state: any)
| 153 | |
| 154 | function updateManyMutably(updates: Update<T>[], state: R): DidMutate; |
| 155 | function updateManyMutably(updates: any[], state: any): DidMutate { |
| 156 | const newKeys: { [id: string]: string } = {}; |
| 157 | |
| 158 | updates = updates.filter((update) => update.id in state.entities); |
| 159 | |
| 160 | const didMutateEntities = updates.length > 0; |
| 161 | |
| 162 | if (didMutateEntities) { |
| 163 | const didMutateIds = |
| 164 | updates.filter((update) => takeNewKey(newKeys, update, state)).length > |
| 165 | 0; |
| 166 | |
| 167 | if (didMutateIds) { |
| 168 | state.ids = state.ids.map((id: any) => newKeys[id] || id); |
| 169 | return DidMutate.Both; |
| 170 | } else { |
| 171 | return DidMutate.EntitiesOnly; |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | return DidMutate.None; |
| 176 | } |
| 177 | |
| 178 | function mapMutably(map: EntityMap<T>, state: R): DidMutate; |
| 179 | function mapMutably(map: any, state: any): DidMutate { |
no test coverage detected