Closed hovancik closed 3 years ago
In this case, I wonder if making the async function a helper that runs initStore()
once you get data back is the better option.
async function getData () {
let value = await asyncCall();
store.do('initStore', value);
}
initStore: (props, value) => {
props.value = value;
},
Thanks for the idea! That indeed seems to work better
Hi,
I am not even sure if this is a reef bug or something else (because I am using electron and not not sure how to reproduce with codepen) but I hoped you might help me with debugging?
So I have setter similar to this:
and I call it when I render my app:
and simply show the value in UI (via
template
).I'm setting up store with simple:
Let's say my async function returns number 42.
And I noticed this weird behavior:
value
usually gets shown as 42cmd+r
,value
does not get shown (it is initial''
)I've put a lot of
console.log
s everywhere butvalue
seems to be set correctly, just not shown in UI. I've fixed it like this:All then works as expected, but is it good idea?