Async data loading in a live component

What are the ways to load data asynchronously in a live component?

So far I’ve tried the following and they all interact with the parent view which I’d like to avoid / hide:

  1. Spawn a task in a stateful component, then send_update from the parent. If the task fails, I don’t have the ref to know the component for which the task has failed in order to retry it.

  2. Spawn the task in the parent view, then update the component. In this approach the logic leaks from the component into the parent view.

Is there some other way I’m missing?

If your components should be isolated in terms of messaging my suggestion would be making it a child liveview process, so it does get its own mailbox.

1 Like

does this example Communicating between LiveViews on the same page – The Pug Automatic provides a decent parent/child structure ?