Jilles van Gurp
12/17/2020, 4:32 PMupdate("xx")
println(current) // prints old value
update("yy")
delay(1000)
println(current) // prints yy
I solved it in my store by also putting the value in a private variable but that feels a bit ugly. Would it be possible to make this more consistent/less flaky?Jan Weidenhaupt
03/02/2021, 7:26 PMmyStore.current
, because the internal data only gets updated, when the myStore.data
flow get collected (rendered or watched). Therefore you should avoid using current
. Instead use the data
flow and the functional-way it is more safe 😉
Sometimes it's easier to get the current
value directly, that is why we left this possibility open, but then you must be sure that your data gets updated before correctly.