I have a problem. I use a AsyncStorage as a cache in my mobile app. But now I face a problem with Promises. I have a static method which looks like this:
static getDiscounts(categoryAndPage) {
return AsyncStorage.getItem(categoryAndPage).then(discounts => {
return discounts
})
}
I expecting that return value should be just some json. But it returns another promise.
var cachedDiscounts = DiscountsCache.getDiscounts(discountCacheKey);
console.log(cachedDiscounts)
This above is a promise which contains my data
I dont want to call then on this.. How to fix this?