Open
Description
I am learning ol.Link, but I can not know when link.track callback run.
this is key code from ol exmple :
const exampleCheckbox = document.getElementById('example-checkbox')
exampleCheckbox.addEventListener('change', function () {
if (exampleCheckbox.checked) {
link.update('example', 'checked')
} else {
// updating to null will remove the param from the URL
link.update('example', null)
}
})
const initialValue = link.track('example', newValue => {
console.log({ newValue }) // NOTE this is never log
exampleCheckbox.checked = newValue === 'checked'
})
exampleCheckbox.checked = initialValue === 'checked'