Vibha Singh
Vibha Singh

Reputation: 23

how to store api fetched data in indexeddb using reactjs

I want fetch data from api and store that data locally. Api response data are of huge amount(in thousands). Basically I'll have to develop e-commerce website so when i refresh page or go to next page data should not disappear. Can anyone tell me how should i do? I thought of using indexedDB but unable to add api response data into it. Any other approach or piece of code for storing api data in indexedDB in reactjs will be helpful. Thanks in advance!

Upvotes: 0

Views: 682

Answers (1)

Josh Merrian
Josh Merrian

Reputation: 331

You could use something called LocalStorage. This saves the data in the user's browser. Look into it here

Upvotes: 1

Related Questions