I'm making multiple .rest().get() requests in my Open Data Table (https://github.com/swook/SocialCountsJS/blob/master/socialcounts.xml), and would like to couple these requests with y.cache to have low latency in general for the query.
So the query would not guarantee the latest data, but would return the previous results (cached per GET) if a timeout is reached.
To achieve this, I'm thinking of firing the GET requests off, then running a function after a timeout which fills in empty results with cached results, then returns early.
I'm hoping the GET requests will be processed after the return and will thus update the cache after the query.
A problem in executing this idea is that setTimeout/setInterval does not exist as the window object doesn't either. Therefore I can't have a function run after a custom timeout.
Is there an equivalent to setTimeout that I can use?
Also, would GET responses be handled as defined in my ODT even after a premature timeout?