Is there any way to have a refresh "function" on AMP pages to repeat a task every X seconds?
I need to call and API url every X seconds and with the response, modify part of page content.
In javascript I was doing it with setTimeout, but I could not find anything that would do it in AMP.
I've checked amp-bind refresh state, but it seems that it only works for tapping interactions.
<div>
<amp-state id="time"
src="/components/time"></amp-state>
<button on="tap:time.refresh">
Refresh
</button>
<div [text]="time"></div>
</div>