I am trying to reduce the callbacks to the rest server for data by limiting a function to run only when the slider.state is"ready" or event.state is "stop".
This codePen illustrates the issue - is there any css or javascript fix for this?
I've noticed that when the user clicks on the slider label the slider button moves, but the event.state never completes and stays at "dragging". This means that there is no state that I can consistently use to fire the rest callback like these examples that don't work:
Doesn't work:
if (slider.state === "ready") {
code that updates the definitionExpression for layers
}
Doesn't work either because the slider doesn't consistently revert to 'ready'
if (event.state ==="stop"){
code that updates the definitionExpression for layers
}
Any help is very appreciated!