Replaces mock data calls in the Product, Menu & Cart MFEs with calls to the Vendure readonly demo API instance
Defines a set of custom events which are used to communicated state changes across MFE boundaries
Makes uses of browser localstorage to store the Vendure session token. This means that cart state is persisted even after page refreshes.
The event system is still crude & untyped, and in a real app we would want to wrap this into some kind of type-safe MFE state management solution I guess. For this demo it works fine though.
1 thing I did not do is to make the cart contents server-rendered. I'm not sure how to do this at the moment as it would involve the server knowing the vendure session token somehow.
This PR makes the following changes:
The event system is still crude & untyped, and in a real app we would want to wrap this into some kind of type-safe MFE state management solution I guess. For this demo it works fine though.
1 thing I did not do is to make the cart contents server-rendered. I'm not sure how to do this at the moment as it would involve the server knowing the vendure session token somehow.