Creating a selection view

First off we need our view in which we will perform the selection:

// demo/selectionView.jsimport dispatcher from "./dispatcher";console.log('selection view loaded');class SelectionView {  selectIndex(index) {    console.log('selected index ', index);    dispatcher.dispatch({      type: "SELECT_INDEX",      data: index    });  }}const view = new SelectionView();export default view;

We have bolded the   selectIndex()   method above that we intend to use.

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.