Skip to content

When link track callback is called? #16316

Open
@jackchoumine

Description

@jackchoumine

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'

The issue: link.trackcallback never call.

repreat issue forked link example

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions