Created
June 26, 2020 11:32
-
-
Save velotiotech/a762975f023a256ff52b6c91c24c59ad 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