Skip to content

Ability to disable/not trigger watch handler on data? #1829

Closed
@dalanmiller

Description

@dalanmiller

For my application, I'm mutating the object in my data: [{...}, {...}, {...}] to state changes occurring at other open instances of my application (happening through web sockets etc, etc). I have a handler on the data structure like this below:

watch: { todos: { deep: true, handler: todoStorage.save, }, }, 

Triggering todoStorage.save would unnecessarily save the contents of the array back to my database where I already know the current state of the application.

Is there a way to mutate the array without triggering the handler? It seems that trying to undefine the handler while making the operation doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions