Cleaning up the view

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.jsimport dispatcher from "./dispatcher";class FirstView {  selectIndex(index) {    dispatcher.dispatch({      type: "SELECT_INDEX",      data: index    });  }}let view = new FirstView();

Adding a few more actions into the mix means we would extend the view with a few methods like this:

// first.viewII.jsimport dispatcher from "./dispatcher";class View {  selectIndex(data) {    dispatcher.dispatch({      type: "SELECT_INDEX",      data    });  }  createProduct(data) {    dispatcher.dispatch({      type: "CREATE_PRODUCT",      data    });  }  removeProduct(data) {    dispatcher.dispatch({      type: "REMOVE_PRODUCT",      data    });  }}let view ...

Get Architecting Angular Applications with Redux, RxJS, and NgRx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.