Wappler Version : 6.0.0 beta 11 beta channel
Operating System :
Server Model:
Database Type:
Hosting Type:
Expected behavior
The items of a data store should be available to a javascript function, immediately after being updated
Actual behavior
The previous data store items are returned
How to reproduce
Given the following page flow:
It repeats over ingredients which is a data store component and updates each ingredient with new values.
After the repeat, I call a javascript function.
Inside the JS function, I reference the ingredients and it shows the items at their original (non-updated) values:
dmx.app.data.content.ingredients.data
Here is what a console.log() of the ingredients is from inside the function:
Notice that the prep ahead and ingredient is 12 fl oz.
I then change the servings, which triggers my page flow and subsequent function.
Here you can see that while the ingredients updated properly, the prep ahead (which comes from the javascript function) did not.
The console log shows the qty
is still 12 (it should be 15)
I then call dmx.app.data from the console after everything has completed, and the qty
shows the proper value of 15.
If I place a 100ms wait before calling the javascript function, it works as expected. But an arbitrary wait is never a great thing and is just a workaround.