alexabbott / firebase-cms

A CMS + E-commerce platform built with Angular and Firebase
https://fir-cms-76f54.firebaseapp.com/
MIT License
313 stars 125 forks source link

Updating cart-icon component to use array.reduce() instead of for loop #1

Closed ankemp closed 7 years ago

ankemp commented 7 years ago

Just a simple change that uses array.prototype.reduce() to do what the for() loop was doing.

Also updated cartItems to have a default (and type is inherited from default (int)). Also wrapped all logic in your if(this.globalCart) statement because of cartItems now having a default

alexabbott commented 7 years ago

@ankemp thanks bud