Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Why not just wait for query to complete? I'm sure there are other ways of monitoring that.
-
Not a js person but any async implementation would have either a callback parameter to execute when done, some sort of event/signal/message sent when done, or a way to wait for it to be done (i.e. force synchronicity). Any of these can be used to do what you want.
Speculating further, you can construct a computation pipe which just waits for the async query and processes it whenever it comes through and then just wait for the query result to come through -
gruff5576yI think you really need to look at promises, you would execute the query then do your work modifying the Dom or application state
Related Rants
Needed to help a friend with her Bachelor Thesis. She writes in Javascript and needs to synchronously use the result of a postgresql query. The query call is asynchronous.
We did what any person that searches for a dirty solution would do.
We saved the result of a query in a file and load the file when we need it.
Why is Javascript a thing?
rant
javascript