...

/

Initial Application Data Fetch

Initial Application Data Fetch

Carry out an application data fetch with a plain Redux application.

Introduction

In this section, we’re going to set up the core data fetch logic for tweetfind. We’ll get this done first without RTK. Then we’ll introduce RTK as we continue. Before doing all that fun stuff, let’s understand how to request your consumer keys and authentication tokens for building a Twitter application.

Performing the data fetch

If a user enters a search term, we will make the data fetch, and log the values to the console.

We’ll use the basic react data fetching technique to accomplish this, and then refactor to use RTK.

First, let’s write the main data fetch handler. Let’s call this findTweets.js and have it in the features/finder directory:

// features/finder/findTweets.js
const URI = "https://t-api.vercel.app/api/sea
...