Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created Jun 26, 2020
Embed
What would you like to do?
Component based MicroFrontend
class Cart extends MicroFrontend {
beforeMount() {
// get previously saved cart from backend
}
render() {
return `<!-- Page -->
<div class="page-area cart-page spad">
<div class="container">
<div class="cart-table">
<table>
<thead>
.....
`
}
addItemToCart(){
...
}
deleteItemFromCart () {
...
}
applyCouponToCart() {
...
}
onDismount() {
// save Cart for the user to get back to afterwards
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment