Funcionalities
- Fetches dummy product data from https://dummyjson.com/products
- Can add and remove products from Cart.
- Can change quantity of the item in the cart.
- Updates the SubTotal of the cart in real time
*Notes for future reference
createSignal()
-> Similar touseState()
in React.onMount()
-> Runs when the component is initialized for the first time. (likeuseEffect()
with empty dep array in React)createEffect()
-> Similar touseEffect()
in React but with no dependency Array (WOWW 😮)- Was surprisingly easy to work with since I've been working with React for sometime
- Uses
vite
-> which is also very fast . class
instead ofclassName
- Instead of using
map
to loop through data SolidJs had aFor
component
Each component is only executed once and only the reactive elements inside it are updated and re-renderd (Unlike React that uses Virtual DOM to Re-render the whole component after a change in state is detected)