text: import {Dispatcher} from 'flux';
  import {ADD_SKILL, ADD_LANGUAGE, REMOVE_SKILL, REMOVE_LANGUAGE} from '../constants/ProfileConstants';
  
  let ProfileDispatcher = new Dispatcher();
  
  import ProfileStore from '../stores/ProfileStore';
  
  ProfileDispatcher.register((payload) => {
  
    let action = payload.action;
    let new_skill = payload.new_skill;
    let new_language = payload.new_language;
    let id = payload.id;
  
    switch(action) {
  
      // Respond to add-item action
      case 'add-item':
        ProfileStore.addItem(new_item);
        break;
      
      // Respond to remove-item action
      case 'remove-item':
        // Remove item logic
        break;
  
      case 'add-skill':
        ProfileStore.addSkill(new_skill);
        break
      case 'remove-skill':
        ProfileStore.removeSkill(id);
        break
      case 'add-language':
        ProfileStore.addLanguage(new_language);
        break
      case 'remove-language':
        ProfileStore.removeLanguage(id);
        break
  
      default:
        return true;
    }
  
    // If action was responded to, emit change event
    ProfileStore.emitChange();
  
    return true;
  
  });
  
  export default ProfileDispatcher;