Closed chandu0101 closed 8 years ago
i think an error object with id doesn't exist
makes more sense than returning undefined
, sorry to be the complaining guy instead of sending PR's, i don't have much experience with javascript i am from scala.js :) , if no one up for this i may send PR sometime in future :)
I fixed it in react-native-store@0.2.3.
cool thanks,Its returning null now.how throwing error/rejecting promise because its not a successfull transaction!
use promise?
hmm may be i am completely out of sync(sorry can't understand whats going in js) , *ByID calls are already returns Promise right ? if no id exist then we can reject promise in API level itself ...
Now return a promise object
https://github.com/thewei/react-native-store/blob/master/libs/model.js#L172
result can be either null/array , return undefined if its null otherwise pop!