QuestionQ85

VerifiedBasic Lightning Web Component Development

How can a developer enable communication between components that are not within the same DOM (Document Object Model) tree?

Explanation

The publish-subscribe pattern decouples components: a publisher emits a message or event, and any subscribing component can receive and handle it without sharing a DOM hierarchy. Salesforce documents publish-subscribe as an option for communication between components outside the same DOM tree, while recommending Lightning Message Service where it is available.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!