Created
February 27, 2020 19:01
-
-
Save birendra-b/d557afe3f45f4044db5babf7730d5d4e to your computer and use it in GitHub Desktop.
Component based MicroFrontend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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