loadNewPages = async () => { //TODO this needs to be looping
this.setState({ pageCount: 3 })
let response;
do { response = await getMembers(this.state.pageCount++, this.state.size*3, this.state.divisionFilter, true),console.log(response)}
while (response.status != 204)
console.log("finished")
console.log(this.props.members)
this.handleRefresh()
}
This code is lazy loading data from a database.
The do while loop is getting an amount of data and checking if more pages are available before re-executing.
Once the response status indicates no more pages the code below should execute, However it does not.
is this a react-js thing or am i just stupid.
Thanks in advance