Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

overwriting the last item #52

Open
flamingo-peacock opened this issue Dec 2, 2016 · 2 comments
Open

overwriting the last item #52

flamingo-peacock opened this issue Dec 2, 2016 · 2 comments

Comments

@flamingo-peacock
Copy link

When I try to add things to my storage, it doesn't always add correctly, and many times just overwrites the last item, it doesn't give a new id, just keeps using the last one.

I was having this issue in another part of my app, where there was a race condition and the first call hadn't finished when the second one started, but that shouldn't be the case here, nor should that be an issue anyway. Storage should be able to handle items coming in rapid succession.

thoughts?

@wjyx1lalala
Copy link

i have get the same problems!!!

@lucasrocha7111
Copy link

I "solve" this problem using setTimeout.

Like this:

setTimeout(() => { Store.model('config').add(values).then((res) => { //Something }).catch(err => { console.log('Error ', err) }) }, 80)

Working here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants