Middleware Flashcards

1
Q

Explain the middleware process

A

1) React components call an action creator
2) Action creators are functions that when called return an action object. That object with type and payload properties
3) Objects get forwarded to a series of middleware functions. These functions give us the ability to log modify or even stop actions that have been returned from the action creators. Think of it as a stop station to check to see what the actions are BEFORE they are sent to reducers
4) Action then moves on to the reducers, which produces a new state and is sent to rerendered with new state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why do we use middleware?

A

We use middleware to look at actions that are about to be sent to a reducer and we get the opportunity to delay the action, modify it, or even STOP the action entirely.

Only way to get asynch requests to work the way we want in a redux application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How would we create our own middleware?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly