You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regarding the exercise, ./src/exercise/03.extra-2.js, caching in a context provider, I just wanted to ask you about this chunk of code:
In the 03.extra-2.js file
In the utils.js file
When the data information about one particular pokemon is not in the cache, then the run function is called. As far as I can understand, and this is my doubt, it seems as if we are resolving the same promise twice, I think in order to sync the async call of the API and then store the information in cache. Are we technically resolving the promise twice? If this is the case, could we have any kind of issue by doing that?
Thank you very much in advance Kent for any kind of comment.
Jose
The text was updated successfully, but these errors were encountered:
Hi @jgarciallamas, remember that simply attaching .then onto a promise does not "resolve" the promise. It's simply a way to say: "when this promise is resolved, do this." So you can do:
Hi Kent,
I hope you are doing well despite the situation.
Regarding the exercise, ./src/exercise/03.extra-2.js, caching in a context provider, I just wanted to ask you about this chunk of code:
In the 03.extra-2.js file
In the utils.js file
When the data information about one particular pokemon is not in the cache, then the run function is called. As far as I can understand, and this is my doubt, it seems as if we are resolving the same promise twice, I think in order to sync the async call of the API and then store the information in cache. Are we technically resolving the promise twice? If this is the case, could we have any kind of issue by doing that?
Thank you very much in advance Kent for any kind of comment.
Jose
The text was updated successfully, but these errors were encountered: