I know that with ref you have an object/array/primitive reactive, and if it was an object or array it is made deeply reactive.
And with shallowRef you can have only the variable itself reactive but is not made deeply reactive.
In my case I have an array of JSONs where I would like to make reactive the array and the first deep level, because the only actions I am doing is push/slice new items or change the array variable.
So I could use ref([]), but this will make the full JSON reactive which I don’t need.
And I can not use shallowRef(), because this will work when changing the full json. But won’t work with the push/slice actions.
Is there something I am missing? How can I do this approach?
const arr = shallowRef([]);
arr.value.push(JSON); // Not reactive
arr.value.slice(index, 1); //Not reactive
arr.value = [JSON_1, JSON_2]; //reactive