hoodiehq-archive / my-first-hoodie

⛔ deprecated
Other
157 stars 35 forks source link

Local storage filled event? #24

Closed robhrt7 closed 11 years ago

robhrt7 commented 11 years ago

Is there an event that catches "local storage ready to work" state? If user come with empty localstorage, on hoodie.store.findAll fist I get an empty array. Only after some time, when localstorage syncs with server I could get real reasponse from findAll method.

My task is to first get information from remote, and then create new object if it isn't there yet.

gr2m commented 11 years ago

not yet, but I agree that this is confusing, you're not the first to run into it. We'll add a "bootstrapping" state, that will fetch all data before resolving findAll and the other store methods. But that'll still take a bit.

What's your use case? Maybe we can work around it until we have the bootstrapping in place

gr2m commented 11 years ago

fixed via https://github.com/hoodiehq/hoodie.js/pull/87