devconcept / ng-shopping-cart

🛒 An Angular component library to create shopping carts
https://devconcept.github.io/ng-shopping-cart/
MIT License
45 stars 53 forks source link

Loader or placeholder when load a value from LocalStorage #6

Closed Alessandroinfo closed 5 years ago

Alessandroinfo commented 5 years ago

Issue checklist

I'm submitting a...

Environment

Angular version: major.minor.patch 8.0.0

NgShoppingCart version: major.minor.patch 1.0.0

Node version: major.minor.patch 12.0.0

Current behavior

Is possible to see a loader in the components when the data are loaded from LocalStorage?

I use this to load the number of total item in cart this.cartService.itemCount() but while the data are taken from LocalStorage i see nothing. Is possibile to show a loader or a placeholder in this fraction of time?

devconcept commented 5 years ago

Data loaded from localStorage is really fast. Check:

https://stackoverflow.com/questions/8074218/speed-cost-of-localstorage

There is no point in adding a loader for this operation because the loader will never be visible on the screen.