Skip to content

jamieathans/Module-Federation-MobX-Example

 
 

Repository files navigation

Sharing Observable State Across Micro-FrontEnds

Worlflows

main

Online IDE

This example runs in Code Sandbox!

Contents

App1

Runs at: http://localhost:1337

This app is acting as a host. It renders a table of Users within itself, below this rendering the contents of App2. The singleton Store is consumed as a Federated Module.

App2

Runs at: http://localhost:1338

This app functions stand-alone but is also consumed by App1 as a Federated Module. The singleton Store is consumed as a Federated Module.

Store

This is more of a library than an application. Using Module Federation Plugin we can share a singleton that both apps interact with.

In this example the store is based on TFRP using MobX - subscriptions are implicit, the store Class and singleton are exported (the store could be instantiated local to an app to avoid sharing)

About

An example of simple shared state/data between micro-frontends

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 49.7%
  • TypeScript 45.1%
  • Less 3.7%
  • HTML 1.5%