Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function _buildColumns(): IColumn[] {
const _item = createListItems(1);
const columns: IColumn[] = buildColumns(_item);
columns.forEach((column: IColumn) => {
if (column.key === 'thumbnail') {
column.name = 'FileType';
column.minWidth = 16;
column.maxWidth = 16;
column.isIconOnly = true;
column.iconName = 'Page';
}
});
return columns;
}
private _onLoadData = (event: React.MouseEvent, checked: boolean): void => {
if (!_items) {
_items = createListItems(ITEMS_COUNT);
_items.map((item: IItem) => {
const randomFileType = this._randomFileIcon();
item.thumbnail = randomFileType.url;
});
}
let items: IItem[];
if (checked) {
items = _items.slice(0, ITEMS_BATCH_SIZE).concat(new Array(ITEMS_COUNT - ITEMS_BATCH_SIZE));
} else {
items = new Array();
this._async.clearTimeout(this._lastTimeoutId);
}
this.setState({
isDataLoaded: checked,
items: items