Let's start by looking at the initial state of the Flux store. In Redux, the entire state of the application is represented by a single store. Here's what it looks like:
export default {
App: {
title: "Neckbeard News",
links: [
{ name: "All", url: "/" },
{ name: "Local", url: "/local" },
{ name: "Global", url: "/global" },
{ name: "Tech", url: "/tech" },
{ name: "Sports", url: "/sports" }
]
},
Home: {
articles: []
},
Article: {
full: ""
}
};
This module exports a plain object. In Redux, you divide up the application state into slices. In this case, it's a simple application, so the store only has three slices of state. Each slice of the state is mapped to a major application feature.
For example, the Home key represents a state that's used by the Home component of your app. It...