Async data in layout?
[issue link]Hi,
Regarding this:
Make the API call in the asyncData() or fetch() methods of the page component and pass the data as props to the sub components. Server rendering will work fine.
(https://nuxtjs.org/faq/async-data-components#async-data-in-components-)
The point is, I have a component that shall work for every page ; so I call it directly in the layout, so it’s not reloaded at each page load. This composent has a google map, the position / zoom / etc. shouldn’t change from one page to another ; it has to be visible and usable at any time, regardless where you are on the site. Basically, it’s like an interactive background.
But it contains markers, that are loaded from a rest API, so I need to get them through asyncData ; and I can’t do it directly on the layout too and pass the data as a props…
How should I proceed?
Thanks.