(newObj)
| 229 | } |
| 230 | |
| 231 | add(newObj) { |
| 232 | const e = this.isValidKey(newObj[this.keyField]); |
| 233 | if (e) throw new Error(e); |
| 234 | |
| 235 | const currentDisplayData = this.getCurrentDisplayData(); |
| 236 | currentDisplayData.push(newObj); |
| 237 | if (this.isOnFilter) { |
| 238 | this.data.push(newObj); |
| 239 | } |
| 240 | this._refresh(false); |
| 241 | } |
| 242 | |
| 243 | isValidKey = key => { |
| 244 | if (key === null || key === undefined || key.toString() === '') { |
no test coverage detected