'use strict';

var Dispatcher = require('flux').Dispatcher;

module.exports = new Dispatcher();

'use strict';

var Dispatcher = require('flux').Dispatcher;

var ACTION_TYPES = require('../constants/action-types');

var dispatcher = new Dispatcher();

dispatcher.dispatch = function (action) {
    if (action.type in ACTION_TYPES) {
        return Object.getPrototypeOf(this).dispatch.call(this, action);
    }

    throw 'Dispatch error: invalid action type ' + action.type;
};

module.exports = dispatcher;

Throw exception if dispatching undefined action type
Throw exception if dispatching undefined action type
