Skip to content

update method is not reactive #1015

@alexdeia

Description

@alexdeia

Hello. The second issue which I found. This issue is related to the timeline. See original visjs/vis-timeline#1562 (comment)

If you want to update items in real-time on the timeline, you can't to do this by update method.

For example. This code updates group but not reactively. Timelines will remain unchanged

const task = this.getTask(taskId)

task.group = newGroupId

// tasks.updateOnly(task) - doesn't work at all. See https://github.com/visjs/vis-data/issues/1014
tasks.update(task)

But if you use add/remove like this then behaviour will be expected: timeline items will be updated in real-time

const task = this.getTask(taskId)

tasks.remove(task)

task.group = newGroupId

tasks.add(task)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions