官术网_书友最值得收藏!

Creating a selection view

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

// demo/selectionView.js

import 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.

主站蜘蛛池模板: 积石山| 龙陵县| 健康| 东乌珠穆沁旗| 黄冈市| 腾冲县| 余干县| 德安县| 安新县| 米易县| 湖州市| 改则县| 株洲县| 图们市| 达日县| 沅江市| 阿合奇县| 桃江县| 岳西县| 遂宁市| 吉木乃县| 宝山区| 泰宁县| 岑巩县| 宜川县| 宁城县| 漳浦县| 星子县| 邵武市| 上高县| 彭泽县| 盖州市| 崇义县| 巴青县| 兰坪| 交口县| 凉山| 青河县| 交城县| 喀什市| 洛川县|