I have seen some blockstack apps with pagination of records. I was wondering how they did that. Lets assume that I have one thousands (1000) provision records in provision.json.
please how do I query
1.) The first 10 records only.
2.) How do I query from 20-30 records etc. below is the code.
some Blockstack Scholars like @Friedger - OpenIntents suggested that getFile is just a http request
My question now is?
Does it mean that If I have one thousand (1000) records of provisions, getFile http request will
fetch them all at once and there is no way to page them at blockstack end or any other means eg via reactjs way.
Again fetching the whole records at once might slow down the app performance.
Can someone give me an insight on what to do or better still a possible solution.
below is my reactjs query code. Thank You
const options = { decrypt: true }
userSession.getFile('myprovision.json', options)
.then((file) => {
var provision = JSON.parse(file || '[]')
this.setState({
provIndex: provision.length,
provision: provision
})
})
.finally(() => {
//ok
})