The Second createStore Argument

We will now learn: a) how to pass the initialState argument into createStore(). b) how to manage our app's state completely through Redux

We'll cover the following...

When you visit the Cashier in the bank, if you asked them for your account balance, they’ll look it up and tell it to you.

widget

But how?

When you first created an account with your bank, you either did so with some amount of deposit or not.

widget

Let’s call this the initial deposit into your account.

Back to Redux.

In the same way, when you create a redux STORE (our own money keeping VAULT), there’s the option of doing so with an initial deposit.

In Redux terms, this is called the initialState of the app.

Thinking in code, initialState is the second argument passed into the createStore function call.

Press + to interact
const store = createStore(reducer, initialState);

Before making any ...