So, we have our core services and can start designing the Redux store. We can describe the intended state mutations in a table:
Action creator |
Action Type |
State Impact |
toggleOpenAddFeed |
TOGGLE_ADD_FEED |
state.isOpenAddFeed |
addFeed |
ADD_FEED |
state.isOpenAddFeed state.feedError |
setFeedError |
SET_FEED_ERROR |
state.feedError |
removeFeed |
REMOVE_FEED |
state.feedError |
fetchFeed |
FETCH_FEED |
state.items |
fetchMenu |
FETCH_MENU |
state.menu state.activeFeedUrl |
setActiveFeed |
SET_ACTIVE_FEED |
state.activeFeedUrl |
First of all, we need to populate our feed menu. For that, we are going to have a modal window with a form to add a feed. The action creator function toggleOpenAddFeed will be used to toggle the visibility of the modal window.
When the form in the modal window is submitted...