title: How to share UI state in single-spa using RxJs?
body: <p>As per the single-spa official doc, we can share the application's UI state by using RxJs.</p>
  
  <blockquote>
    <p>Observables / Subjects (RxJs) - one microfrontend emits new values to
    a stream that can be consumed by any other microfrontend. It exports
    the observable to all microfrontends from its in-browser module, so
    that others may import it.</p>
  </blockquote>
  
  <p>Link: <a href="https://single-spa.js.org/docs/recommended-setup/#ui-state" rel="nofollow noreferrer">https://single-spa.js.org/docs/recommended-setup/#ui-state</a></p>
  
  <p>Link: <a href="https://single-spa.js.org/docs/faq/#how-can-i-share-application-state-between-applications" rel="nofollow noreferrer">https://single-spa.js.org/docs/faq/#how-can-i-share-application-state-between-applications</a></p>
  
  <p>I was trying to create an example in React, where I am using single-spa parcel to include my micro-apps in root application. I was trying to share the UI state using RxJs.
  When I googled it for single-spa RxJs, I didn't find anything. Can anyone provide me a basic example where I will be able to share UI state for below use cases:</p>
  
  <ul>
  <li>Sharing the UI state from root app to my micro-apps.</li>
  <li>Sharing the UI state from micro-apps to root apps.</li>
  <li>Sharing the UI state between micro-apps.</li>
  </ul>