Adding a handle_info callback to LiveComponents

I’m not sure if I agree with that statement because the LiveComponent state will also need to be stored, though not in a lightweight process, but in the parent LiveView. However, I don’t think that’s the main point of the discussion.

I understand that the initial problem you’re trying to solve is the communication between LiveComponents and PubSub. Since the discussion has shifted towards efficiency, I believe it would be beneficial to avoid creating a separate process to accommodate this feature. Instead, a “message broker” within the LiveView itself could handle this task, eliminating the need to spawn additional processes. This approach is more efficient and avoids introducing extra complexity to the LiveComponents.

2 Likes