Pass dynamic data between components | Community
Skip to main content
New Participant
Feb 14, 2022 8:43 PM UTC
Solved

Pass dynamic data between components

Hi all,

I'm looking for a way to pass data to multiple components while only loading the data once. For example:

Component A (or model / sling resource) makes an http call and gets data back that it stores.

 

I now need to pass this data to component B and C but with out calling on my third-party API. (I only want to make my API call once and then share the data.)

 

Any help here would be great!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Nitin_laad
Nitin_laadAccepted solution
New Participant
Feb 14, 2022 10:03 PM UTC

@sincore1 You should be able to cache third party API response into model object, and you can use same model object across the components. 

Apache Sling :: Sling Models 

1 reply

Nitin_laad
Nitin_laadAccepted solution
New Participant
Feb 14, 2022 10:03 PM UTC

@sincore1 You should be able to cache third party API response into model object, and you can use same model object across the components. 

Apache Sling :: Sling Models 

Translate