You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
domoritz
changed the title
What's the expected behavior inserting without awaiting runAsync?
What's the expected behavior of inserting without awaiting runAsync?
Apr 7, 2020
The issue may not be specific to view.insert() but to view.runAsync() in general. In Vega View API documentation, await is required when view.runAsync() is used within an async function: https://vega.github.io/vega/docs/api/view/
Adding await gives the expected result.
.then(async (result) => {
const view = result.view;
for (const i of [1,2,3,4,5,6,7,8,9,10]) {
await view.insert("foo", [{a: i, b: i}]).runAsync()
}
The expected behavior is that one should use await (or Promise chaining) before issuing additional changesets. (As currently implemented, applying a new changeset such as an insert before a previous one has been processed can overwrite the prior changeset.) At minimum, we should update the documentation to reflect this.
I am wondering about the expected behavior when I run something like
Vega does not process all insertions and therefore some data points are missing.
The docs say that I should call `runAsync' after inserting some data but do not specify that I have to await them.
Would it make sense to queue updates here?
Working example at http://bl.ocks.org/domoritz/d5dfd5d195aa7dc838999a25f2dfae02/a82bd83499389296ab6cfcf8987aacbb7eaf5dc4
The text was updated successfully, but these errors were encountered: