const refreshOrders = (e, done) => {
Promise.all([
$store.dispatch('loadOrders', {retries: 3, backoff: 300})
]).then((res) => {
console.log({res}); //array data is returned ok with all orders
$store.state.userOrders = res.orders; //I change the state content of userOrders
$update(); //here $update() does not rerender anything; do nothing :(
done();
got it! thanks I think I have a clue why is not responding as it should! I am in the same page not in store.js
I made this modification and now it works!
this is working now!
userOrders = res.orders;
$update();
this was not working as shown before:
$store.state.userOrders = res.orders; //assigned and content changes but not updated
$update();
I think in conclusion that $update will update only the state of local declared variables on the same page as declared here…
let userOrders = $store.getters.userOrders.value;
I think I have found a solution to refresh content from other pages I will use
state.userOrders = new_array();
and then returning to that page where I want the content to be updated it will be updated already because it reads it using $store.getters.userOrders.value!
I found the solution for the refresh deejay! thanks for the tips!
and yes the returned value after promise is done is always an array!
the issue was using $store.state.userOrders = res.orders; with update(); it does not update anything or refresh page content but using userOrders = res.orders; with update(); it refreshes the content rerendering my local vars again!