I am having a hard time to understand in the code below where these “action.list”, “action.quoteIndex”, “action.colorIndex” are from?
How do all these above come from? Are they from “state”?
From what I understand, “action” in React-Redux is an object with “type” filed and “payload” for extra data if needed: “action.type” and “action.payload”.
Or did I miss anything?
I have never seen this type of writing for action before, but in this example I also don’t see any writing like this for action.
The codes for Action in this example are here:
Np. Note an action is just a plain object with a type property and some other properties. That’s it, nothing more. In your example, the action is being created using a function, and the type is using a variable, but it’s still just a plain object. Those abstractions been added over the top for the benefit of that particular program I assume, but the action is still just that plain object.
Thank you. Yes, I knew “action” is just an object. I was just so confused with those new fields or properties written in these action creator functions and was not linking them to “action” except “type”.