DockYard / ember-cart

Shopping cart primitives for Ember
MIT License
53 stars 18 forks source link

Fix dumpToLocalStorate guard race condition #15

Closed linstula closed 9 years ago

linstula commented 9 years ago
bcardarella commented 9 years ago

What's the thinking behind removing on('init')?

linstula commented 9 years ago

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.

bcardarella commented 9 years ago

I think that is a race condition issue then, one that can be addressed in the initializer.