You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 });
}
The text was updated successfully, but these errors were encountered:
Here is a snippet from my setupImpagination function. This stopped when the page offset was 14. Thanks
The text was updated successfully, but these errors were encountered: