This repo is broken down into 4 projects and a server
- App
- Fragment Module One
- Fragment Module Two
- Fragment Module Three
- Server
App is responsible for layout, messaging and rendering fragment modules.
Fragments are single purpose mini apps that receive parameters via query strings and events. Events are based off a Pub/Sub model documented in the fragment README.
Server is responsible all web request for app, fragments and microservice api's.
npm install
npm run build
npm start
window.messaging.send("module-one-button-click")
window.messaging.send({event: "module-two-button-click", payload: "buy"})
window.messaging.subscribe("module-one-button-click", function(){
console.log("Module Two Received Module One Event");
})
window.messaging.subscribe("module-two-button-click", function(data) {
console.log(data); // buy
})