码迷,mamicode.com
首页 > 其他好文 > 详细

[Flux] 2. Overview and Dispatchers

时间:2015-09-04 17:04:14      阅读:252      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

Flux has four major components: Stores, Dispatchers, Views, and Actions. These components interact less like a typical MVC and more like an Event Bus. 

 

src/js/dispatchers/app-dispatcher.js

var Dispatcher = require(‘flux‘).Dispatcher,
    assign = require(‘react/lib/Object.assign‘);

var AppDispatcher = assign(new Dispatcher(), {
    handleViewAction: function (action) {
        this.dispatch({
            source: ‘VIEW_ACTION‘,
            action: action
        });
    }
});

module.exports = AppDispatcher;

 

[Flux] 2. Overview and Dispatchers

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/4781910.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!