How to use bpk-component-infinite-scroll - 2 common examples

To help you get started, we’ve selected a few bpk-component-infinite-scroll examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Skyscanner / backpack / packages / bpk-docs / src / pages / InfiniteScrollPage / InfiniteScrollPage.js View on Github external
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',
github Skyscanner / backpack / packages / bpk-docs / src / pages / InfiniteScrollPage / InfiniteScrollPage.js View on Github external
}
      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.',

bpk-component-infinite-scroll

Backpack infinite scroll component.

Apache-2.0
Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis

Similar packages