<commit_before>/*
 * Copyright 2017-present, Hippothesis, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

'use strict';

import ActionTypes from '../constants/ActionTypes';

// Add a new ingredient to the shopping list
export function addIngredientToShoppingList(name) {
  return {
    type: ActionTypes.shoppingList.ADD_INGREDIENT,
    payload: {
      name
    }
  };
}

/*
 * Add a new ingredient to the shopping list
 * NOTE: This function also adds the new ingredient to the ingredients
 * list as well
 */
export function addIngredientToShoppingList(id, name) {
  return (dispatch) => {
    dispatch(addIngredient(id));
    dispatch(addIngredientToIngredients(id, name));
  };
}

// Remove an ingredient from the shopping list
export function removeIngredientFromShoppingList(id) {
  return {
    type: ActionTypes.shoppingList.REMOVE_INGREDIENT,
    payload: {
      id
    }
  };
}

// Edit an ingredient in the shopping list
export function editIngredientInShoppingList(id, name) {
  return {
    type: ActionTypes.shoppingList.EDIT_INGREDIENT,
    payload: {
      id,
      name
    }
  };
}<commit_msg>hotfix to doubledeclaration<commit_after>/*
 * Copyright 2017-present, Hippothesis, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

'use strict';

import ActionTypes from '../constants/ActionTypes';

// Add a new ingredient to the shopping list
export function addIngredientToShoppingList(name) {
  return {
    type: ActionTypes.shoppingList.ADD_INGREDIENT,
    payload: {
      name
    }
  };
}

/*
 * Add a new ingredient to the shopping list
 * NOTE: This function also adds the new ingredient to the ingredients
 * list as well
 */

/*
  export function addIngredientToShoppingList(id, name) {
    return (dispatch) => {
      dispatch(addIngredient(id));
      dispatch(addIngredientToIngredients(id, name));
    };
  }
*./

// Remove an ingredient from the shopping list
export function removeIngredientFromShoppingList(id) {
  return {
    type: ActionTypes.shoppingList.REMOVE_INGREDIENT,
    payload: {
      id
    }
  };
}

// Edit an ingredient in the shopping list
export function editIngredientInShoppingList(id, name) {
  return {
    type: ActionTypes.shoppingList.EDIT_INGREDIENT,
    payload: {
      id,
      name
    }
  };
}
{'fraction_non_alphanumeric': 0.09137658227848101, 'fraction_numerical': 0.0031645569620253164, 'mean_word_length': 3.3379073756432245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6181596', 'n_tokens_mistral': 798, 'n_tokens_neox': 774, 'n_words': 234}