the value of a variable is assigned through a function that gets back-end data asynchronously. How to deal with the logic related to this variable as soon as it has a value? How to judge the timing? 
 one way is to use a timer to determine the interval time. Is there any other way? 
