Closed linstula closed 9 years ago
What's the thinking behind removing on('init')
?
It seems that when an ArrayProxy is initialized, it initialized with an empty array as the content. When the observer fires on init, its basically overwriting localStorage to an empty cart, so, it'll blow your cart away if you had stuff in the cart on init.
I think that is a race condition issue then, one that can be addressed in the initializer.
isNotEmpty
guard for_dumpToLocalStorage
becuase we want localStorage to be updated if we remove items from the cart viaremoveItem
.