Fork me on GitHub
#re-frame
<
2023-04-23
>
danielstockton15:04:11

I've rewritten my graphql calls for the nodejs environment, but there's another problem: to load data for my route, i trigger an event (dispatch-sync) but this event fires requests which are other events and not synchronous. This means the server returns the HTML before the data is actually loaded. I suppose i have to rewrite the entire data load to be blocking/wait for a promise, before returning the response. Struggling to keep it DRY...

p-himik16:04:00

On the backend, you can in theory replace all the calls to subscribe with something that blocks till the data is available and then returns the data itself instead of relying on whatever's in app-db.

danielstockton17:04:41

Sounds good in theory, need to think about how i could implement in practice.