DEV Community

Mimis161x
Mimis161x

Posted on

Just learned how to fetch api...

Well it seems so weird to me not being able to store the object data in my code for further use (outside of the fetch scope/function etc.)

Top comments (2)

Collapse
 
mrlinxed profile image
Mr. Linxed

Hey! Welcome to Dev.to

Would you like to elaborate a bit more on what you've learned and the problems you've ran into? Someone else might be able to learn from it too!

Best of luck

Collapse
 
mimis161x profile image
Mimis161x

I was basically trying to fetch the product data from fakestore.api and then add an event listener to a button to change the order shown based on the price. Originally when i had the object data inside my code i could just store the original array somewhere and then change the order of the products by adding: 'contain.style.flexFlow = "row-reverse wrap-reverse";' Now it seems much more complicated when im fetching the data