My VueJS and Observer objects are causing me trouble. I am encountering an issue where I assign a part of my object to a temporary variable for later use, update the original part with new data, and then revert it back to its original state after 8 seconds.
The Object is linked to a list view that displays these two different states uniquely.
I am trying to find a way to prevent the observer from watching my temporary variable, but I'm having difficulty figuring it out.
Below is the code segment I am currently working with:
var temporary = core_data.map_data[data.selected]; //I want this variable to remain unobserved.
core_data.map_data[data.selected].colour = data.colour;
core_data.map_data[data.selected].message = data.message;
core_data.map_data[data.selected].type = "ping";
setTimeout(
function () {
core_data.map_data[data.selected] =temporary;
// console.log(core_data.map_data);
}, 8000);