Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.elements.push(`Item ${index + i}`);
}
resolve(this.elements.slice(index, index + nElements));
});
}
}
class DelayedDataSource extends ArrayDataSource {
fetchItems(index, nElements) {
return new Promise(resolve => {
setTimeout(() => resolve(super.fetchItems(index, nElements)), 500);
});
}
}
const InfiniteList = withInfiniteScroll(List);
const defaultFetch = new ArrayDataSource(elementsArray);
const components = [
{
id: 'default',
title: 'Default',
blurb: 'Loads five more list items upon reaching the bottom of the list.',
examples: [
,
],
},
{
id: 'one-element-per-scroll',
title: 'One element per scroll',
}
resolve(this.elements.slice(index, index + nElements));
});
}
}
class DelayedDataSource extends ArrayDataSource {
fetchItems(index, nElements) {
return new Promise(resolve => {
setTimeout(() => resolve(super.fetchItems(index, nElements)), 500);
});
}
}
const InfiniteList = withInfiniteScroll(List);
const defaultFetch = new ArrayDataSource(elementsArray);
const components = [
{
id: 'default',
title: 'Default',
blurb: 'Loads five more list items upon reaching the bottom of the list.',
examples: [
,
],
},
{
id: 'one-element-per-scroll',
title: 'One element per scroll',
blurb: 'Loads one more list item upon reaching the bottom of the list.',