forked from mystiq/hydrogen-web
rename SortedArray.replace to update
This commit is contained in:
parent
d8d97c40f7
commit
f976eeaf13
2 changed files with 5 additions and 3 deletions
|
@ -76,7 +76,9 @@ export class Timeline {
|
|||
|
||||
replaceEntries(entries) {
|
||||
for (const entry of entries) {
|
||||
this._remoteEntries.replace(entry);
|
||||
// this will use the comparator and thus
|
||||
// check for equality using the compare method in BaseEntry
|
||||
this._remoteEntries.update(entry);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,11 +41,11 @@ export class SortedArray extends BaseObservableList {
|
|||
}
|
||||
}
|
||||
|
||||
replace(item) {
|
||||
update(item, updateParams = null) {
|
||||
const idx = this.indexOf(item);
|
||||
if (idx !== -1) {
|
||||
this._items[idx] = item;
|
||||
this.emitUpdate(idx, item, null);
|
||||
this.emitUpdate(idx, item, updateParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue