question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to pass data to dataSources asynchronously?

See original GitHub issue

Trying JungleJS for the first time now, good work!

I wonder if it’s possible to query data from an external source (eg. fetch from external API) then pass it to dataSources items?

The problem is, it has to be done asynchronously. Is it possible at all to return exports in jungle.config.js asynchronously? Or is there any other way to achieve this?

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
ConProgrammingcommented, Oct 28, 2020

I’ve changed the Sanity schema so slug is just a string in the top level of the returned object. Take a look at @stordahl/jungle-sanity and let me know if you see any glaring issues! I’m getting a graphql error now, but the dynamic pages are being rendered now!

Awesome! Never worked with Sanity before but nice to know you can do that. And yep I’ll make sure to clone it later tonight and poke around!

2reactions
stordahlcommented, Dec 17, 2020

@hangtwenty Please submit a PR or at least share more of your jungle.config.js so we can see what’s going on

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I have an async stream return with 2 data sources
The easiest solution is to just use a single buffer with multiple producers and a single consumer combined with a message packet. The ......
Read more >
Synchronous vs. Asynchronous data sources - Level Up Coding
One common misunderstanding, especially when testing reactive streams, is treating synchronous data sources as asynchronous.
Read more >
How To Handle Async Data Loading, Lazy Loading, and ...
In this tutorial, you'll handle asynchronous data in React by creating an ... function that simulates a request to an external data source....
Read more >
DataSource - How to send an asynchronous request from ...
Hi, I would like to know if it's possible to force synchronous execution in the DataSource 'map' block. ... var ds = new...
Read more >
Synchronous Vs. Asynchronous Data Sources
Distinguish between synchronous and asynchronous data sources, which is essential when dealing with reactive streams. ... One common misunderstanding, especially ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found