-: We just put together our
onSubmit callback inside of our SignUp Form.
In this section, we'll continue
by putting together our signup action creator.
Before we do, we're gonna take a brief detour,
and we're going to put together the Redux Form middleware
inside of our application and wired up to our Redux store.
Now, if you're here in this course,
I'm going to assume that you've never used Redux Form
or, sorry, Redux Thunk before.
So we will be doing a discussion about what we use it
for and how we use it to make asynchronous action creators.
But we're gonna first wire it up right now,
and we'll come back in just a moment,
and we'll talk about exactly how we use it.
So first, wiring it up.
Back inside of my code editor
I'll find my source index.js file.
We're going to import Redux Thunk, which is a middleware,
and tie it together with our createStore call right here.
To wire up a middleware to the createStore call,
I need to first make sure
that I import the applyMiddleware function
from redux,
and then right after that, I'll add on an import
for reduxThunk from redux-thunk like so.
Now, rather than trying to sneak in the applyMiddleware call
directly to createStore right here,
I'm going to instead create a temporary variable
right above our ReactDOM.render call
just so we have a little bit of space
to actually declare the store
without mixing all that stuff into our jsx right here.
So I'm going to define const store as createStore,
and now we've got a little bit of space.
So we'll do our reducers, our initial state,
and then we'll call applyMiddleware,
and as the first and only argument to that
we're gonna pass in reduxThunk like so.
Now, rather than trying to stick everything directly
into the store prop, we will remove
that createStore call and replace it simply with store,
which we defined right above.
Okay, so that looks good.
Let's take a brief pause right here.
We're gonna come back to the next section.
We're gonna start working on that signup action creator
and talking about exactly what reduxThunk does for us.
So I'll see you in just a minute.