react-native-store icon indicating copy to clipboard operation
react-native-store copied to clipboard

Store doesn't returned saving data efficiently (weird)

Open waleedarshad opened this issue 8 years ago • 3 comments

300 and 40 stars and not a single tutorial or Example I am impressed with the popularity of react-native-store but unable to implement. Let me write a secnario

var storage = { 'following': Store.model('following'), 'token': Store.model('token') }

storage.following.add({following: responseData}) storage.token.add({token: responseData.token})

storage.following.find().then(resp => console.log(resp)); storage.token.find().then(token => console.log(token));

whenever i try to fetch i am unable to get the required results. sometimes it returned null and sometime it returned only one from the two.

waleedarshad avatar Jul 01 '16 11:07 waleedarshad

@thewei @hasty @vermilion1 @neoborn ?

waleedarshad-vf avatar Jul 02 '16 09:07 waleedarshad-vf

Are they saving properly? I am having issues here as well, but my last entry just keeps getting overwritten, rather than adding the next _id and the next entry. Wondering if this might be the same issue?

flamingo-peacock avatar Dec 02 '16 20:12 flamingo-peacock

add is an asynchronous method as well, can you try to await or chain it before calling your find methods?

peterjuras avatar Jan 17 '17 06:01 peterjuras