(data: any[])
| 136 | } |
| 137 | |
| 138 | @action initial(data: any[]) { |
| 139 | // put items one by one if not already in the array if they are that means they come from an |
| 140 | // update event the event is always considered the latest data so we don't overwrite it |
| 141 | // with REST data |
| 142 | for (const element of data) { |
| 143 | const id = element[this.descriptor.fieldId]; |
| 144 | if (!this.idsBeforeResolve.has(String(id))) { |
| 145 | this.put(element); |
| 146 | } |
| 147 | } |
| 148 | this.resolved = true; |
| 149 | this.idsBeforeResolve.clear(); |
| 150 | this.recomputeQuery(); |
| 151 | } |
| 152 | |
| 153 | @action put(element: any) { |
| 154 | const id = element[this.descriptor.fieldId]; |
no test coverage detected