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.