Here is a snippet from my setupImpagination function. This stopped when the page offset was 14. Thanks
setupImpagination() {
let _this = this;
let dataset = new Dataset({
pageSize: 4,
loadHorizon: 10,
// pageOffset: this.state.pageOffset,
// Anytime there's a new state emitted, we want to set that on
// the componets local state.
observe: (datasetState) => {
this.setState({ datasetState });
},
// Where to fetch the data from.
fetch(pageOffset, pageSize, stats) {
console.log('page offset - ' + pageOffset);
console.log('page size - ' + pageSize);
var URL = 'https://example.com/wp-json/custom/v1/article_video_callback/?page=' + pageOffset + '&per_page=' + pageSize;
return fetch(URL)
.then(response => response.json())
.catch((error) => {
console.error(error);
});
}
});
// Set the readOffset to the first record in the state
dataset.setReadOffset(0);
this.setState({ dataset });
}
Here is a snippet from my setupImpagination function. This stopped when the page offset was 14. Thanks