Storing Fetch data from API locally

时间:2019-04-08 12:56:34

标签: reactjs

I am attempting to store fetched data from an API and save into either a local file or into a database. So far I have a fully functioning fetch() method that is capable of displaying data onto a front-end application but I am unsure as to how to do the latter.

The following is my fetch method:

    fetch('https://thesession.org/events/new?format=json&perpage=50')
              .then(res => res.json())
              .then(events => {
                this.setState({
                  newEvents: events.events
                });
              });

0 个答案:

没有答案