<commit_before>import * as Constants from '../constants/following_constants';
import followingHelpers from '../utils/following_helpers';


export const following = ( state = {
  user1Compare: [],
  user2Compare: []
}, action ) => {
  switch ( action.type ) {
    case Constants.REQUEST_FOLLOWING:
      return Object.assign( {}, state, {
        [action.user]: followingHelpers.fetching( state[action.user], action )
      });
    case Constants.RECEIVE_FOLLOWING:
      return Object.assign( {}, state, {
        [action.user]: followingHelpers.fetching( state[action.user], action )
      })
    case Constants.COMPARE_FOLLOWING:
      return Object.assign( {}, state, {
        user1Compare: followingHelpers.compare( action.user1, action.user2 ),
        user2Compare: followingHelpers.compare( action.user2, action.user1 )
      });
    default:
      return state
  }
}<commit_msg>update following reducer to handle loading state<commit_after>import * as Constants from '../constants/following_constants';
import followingHelpers from '../utils/following_helpers';


export const following = ( state = {
  loading: true,
  user1Compare: [],
  user2Compare: []
}, action ) => {
  switch ( action.type ) {
    case Constants.REQUEST_FOLLOWING:
      return Object.assign( {}, state, {
        [action.user]: followingHelpers.fetching( state[action.user], action )
      });
    case Constants.RECEIVE_FOLLOWING:
      return Object.assign( {}, state, {
        [action.user]: followingHelpers.fetching( state[action.user], action )
      })
    case Constants.COMPARE_FOLLOWING:
      return Object.assign( {}, state, {
        user1Compare: followingHelpers.compare( action.user1, action.user2 ),
        user2Compare: followingHelpers.compare( action.user2, action.user1 ),
        loading: false
      });
    default:
      return state
  }
}
{'fraction_non_alphanumeric': 0.1254054054054054, 'fraction_numerical': 0.008648648648648649, 'mean_word_length': 3.2551724137931033, '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': '2956872', 'n_tokens_mistral': 531, 'n_tokens_neox': 533, 'n_words': 114}