Let's do a reality check here. We haven't built the Flux flow as prettily as we could make it. The overall picture is correct but it'd be nice if we can clean it up a bit to make room for more actions so we get a real sense of how the application should grow from here.
The first order of business is to have a look at our first view and how it reacts to user interactions. It looks like this currently:
// first.view.js import dispatcher from "./dispatcher"; class FirstView { selectIndex(index) { dispatcher.dispatch({ type: "SELECT_INDEX", data: index }); } } letview=newFirstView();
Adding a few more actions into the mix means we would extend the view with a few methods like this:
// first.viewII.js import dispatcher from"./dispatcher"; class View { selectIndex(data) { dispatcher.dispatch({ type: "SELECT_INDEX", data }); } createProduct(data) { dispatcher.dispatch({ type: "CREATE_PRODUCT...