Skip to content

Commit

Permalink
[bugfix] header.update is back
Browse files Browse the repository at this point in the history
  • Loading branch information
justinjung04 committed Oct 22, 2018
1 parent 2b9b073 commit 60da479
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/apis/setHeaderItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,18 @@ const Header = {
return this;
},
/* rethink update later */
// update(arg) {
// if (typeof arg === 'object') {
// this._updateItem(arg);
// } else if (Array.isArray(arg)) {
// this._updateItems(arg);
// } else {
// console.warn('Argument must be either an object or an array');
// }
update(arg) {
// if (typeof arg === 'object') {
// this._updateItem(arg);
// }
if (Array.isArray(arg)) {
this._updateItems(arg);
} else {
console.warn('Argument must be an array');
}

// return this;
// },
return this;
},
// _updateItem(obj) {
// if (this.index === -1) {
// console.warn('Please use .get(dataElement) first before using update');
Expand All @@ -151,11 +152,11 @@ const Header = {

// return this;
// },
// _updateItems(items) {
// this.headers[this.headerGroup] = items;
_updateItems(items) {
this.headers[this.headerGroup] = items;

// return this;
// },
return this;
},
_setIndex(dataElement) {
this.index = this._getIndexOfElement(dataElement);
},
Expand Down

0 comments on commit 60da479

Please sign in to comment.