Answer the question
In order to leave comments, you need to log in
How not to download the same data from the API if there were no changes?
Here is the code that receives the data via the API:
async componentDidMount() {
var URL = 'https://example.com/api/get/data/';
await fetch(URL)
.then((response) => response.text())
.then(async (responseText) => {
await AsyncStorage.setItem('db_qs', responseText);
})
.catch((error) => {
console.warn(error);
});
}
Answer the question
In order to leave comments, you need to log in
How not to download the same data from the API if there were no changes?
There is a type of web sockets connection, in which the server itself can send you data when they have changed, I don’t know how suitable this option is in your case, but you won’t be able to find out from the front when the data has changed on the server, only on the server it’s clear and it should notify the client part about it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question