Answer the question
In order to leave comments, you need to log in
How to make work on react native setInterval in background?
The bottom line is this:
There is a certain queue Queue
and there is a setInterval
setInterval(async () => {
if(Queue.length > 0){
let item = Queue.shift();
}
}, 500)
Answer the question
In order to leave comments, you need to log in
Regarding timeouts, if I'm not mistaken, the js stream falls asleep when I apply it in the background.
You can remember the timestamp when the timer starts, and when the application is back in the foreground, operate on the time difference.
This query will display all items that have more than 10 floors:
SELECT i.name
FROM `items` i
JOIN `item_attribute` ia ON ia.item_id = i.id AND ia.attribute_id = :aid
JOIN `values` v ON v.attribute_id = ia.attribute_id
WHERE v.value > 10
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question