One PubSub: A PubSub Library for Lightning Web Component and Aura Component

Reading Time: < 1 minute

LWC PubSub

About:

This blog is about PubSub events to communicate between LWC to LWC, Aura to Aura and LWC to Aura and vice versa.

This blog and One PubSub library are written while attending the Hyderabad event. Great event!!!

Features

  • Subscribe and handle PubSub events using declaratively.
  • One framework for PubSub that works in both LWC and Aura Component.
  • Reduces code errors.
  • Uniformity across the LWC and Aura Components to use the PubSub events.
  • Use namespace to define the group the events.
  • The pattern of use is quite the same as the Aura Component events. Easy for the Aura Component Developers.

Documentation

Please check out the Github Repo for updated release and documents.

Github Repo: https://github.com/TheVishnuKumar/one-pub-sub-lwc

2 thoughts on “One PubSub: A PubSub Library for Lightning Web Component and Aura Component

  • June 13, 2019 at 6:04 pm
    Permalink

    Hello Vishnu,
    Thanks for writing this blog it’s really very helpful, But I found one thing which is confusing can you please correct this for other.
    In case of Step-3, we are firing event not handling
    Step 3. Create aura_component_1 Aura Component. This component is handling the event.
    So It should be Firing.
    Please correct me if i am wrong.
    Thanks

    Reply
    • June 18, 2019 at 3:37 am
      Permalink

      Yes, You are right. This is firing the event. I have updated the blog. Thanks!1

      Reply

Leave a Reply