I'm trying to trigger my API to fetch data every 10 seconds if the current time is between 5am and 9am only.
For the sake of testing I've changed the ternary operator code to the testing current time.
The ternary operator works fine, it returns true or false however the query fails to run when I use it. When I load the page on the ternary operator being = to true and it then changes to false because time has passed the query never triggers despite it being set to run periodically every 10 seconds. I've watched the API state with 'isFetching' inserted into a text component on the app in preview mode and it never changes from 'false' as the the ternary operator changes from true to false.
I can't put the ternary operator in a separate JS query because the JS query doesn't provide the ability to run periodically. On testing it seems that using the ternary operator breaks the 'run periodically' setting.
{{ moment().isBetween(moment().hour(12).minute(59).second(0), moment().hour(13).minute(0).second(0)) ? false : true }}