In the viewModel I have a Map which is refreshed every 5s :
Constructor(){
this myMap=new Map();
}
activate(){
//for example :
value=7;
id=1;
setInterval(()=>{
this.myMap.set(id, value++);
});
},5000);
}
In the view :
<template>
<div class="container">
<h2>${titre}</h2>
<p class="nb-values-OK">
${myMap.get(1)}
</p>
</div>
</template>
Nothing happen when interval triggers ... Is there any way to have my view refreshed when the timer triggers ?
In fact in the real world, I have lanes and on these lanes there are some activities ; so my map do the link between a lane id and the number of activities which take place on that lane. It appears to me that a Map is the simplest way to sort this ... Anyway, my first question concerns the way to have my view refreshed every 5sec.
Thanks in advance for any help. `
(Hope my english is good enough to be understandable :)).