computed property with little change in depth
Hello,
I encounter a refresh problem with a component.
Not sure but I wonder if it's not due to the computed property.
const endpoints = computed(() => {
return dashboardStore.endpoints.filter(endpoint => endpoint.active_connection.branch_id === (props.branch ? props.branch.id : null));
});
Sometimes there is only endpoint.active_connection.branch_id that changes inside the endpoints array.
Here is my code that reload the endpoints.
async function loadEndpoints() {
const res = await dashboardService.endpoints();
endpoints.value = res.data.data;
}
With endpoints.value = res.data.data;, I don't know if the endpoints array is reset entirely if only one property of one endpoint is updated.
Can you confirm that any change of the branch_id will trigger a new calculation of the computed property ? If yes, I have to find the problem somewhere else, if no, how can I solve my problem ?
Thanks for your help.
V
Please or to participate in this conversation.