Code coverage report for ReactFlux/lib/index.js

Statements: 80% (12 / 15)      Branches: 100% (0 / 0)      Functions: 80% (4 / 5)      Lines: 80% (12 / 15)      Ignored: none     

All files » ReactFlux/lib/ » index.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 681 1 1 1 1 1   1   1               23                 51                 10                 1                                              
var Constants = require('./constants');
var Actions = require('./actions');
var Store = require('./store');
var MixinFor = require('./mixinFor');
var Dispatcher = require('./dispatcher');
var Configs = require('./configs');
 
var dispatcher = new Dispatcher();
 
module.exports = {
 
	configs: Configs,
	/**
	 * createActions
	 * @param {object} actions
	 */
	createActions: function (actions) {
		return new Actions(dispatcher, actions);
	},
 
	/**
	 * createStore
	 * @param {object} storeMixin
	 * @param {array} handlers
	 */
	createStore: function (storeMixin, handlers) {
		return new Store(dispatcher, storeMixin, handlers);
	},
 
	/**
	 * createConstants
	 * @param {array} constants
	 *
	 */
	createConstants: function (constants, prefix) {
		return new Constants(constants, prefix);
	},
 
	/**
	 * dispatch a message
	 * @param {string} constant
	 * @param {object} payload
	 */
	dispatch: function (constant, payload) {
		dispatcher.dispatch(constant, payload);
	},
 
	/**
	 * The global dispatcher
	 */
	dispatcher: dispatcher,
 
	/**
	 * Mixin
	 */
	mixin: function () {
		console.warn("ReactFlux.mixin is deprecated. please use ReactFlux.mixinFor");
		var args = Array.prototype.slice.call(arguments);
		MixinFor.call(this, args);
	},
 
	/**
	 * Mixin
	 */
	mixinFor: MixinFor
 
};