<commit_before>import { take, call, put, fork } from 'redux-saga/effects'
import api from 'services'
import { PICTOGRAMS, pictograms, AUTOCOMPLETE, autocomplete } from './actions'

// Individual exports for testing
export function* defaultSaga() {
  yield fork(pictogramsFlow)
}

function* pictogramsGetData() {
  while (true) { // eslint-disable-line no-constant-condition
    const { searchText } = yield take(PICTOGRAMS.REQUEST)
    console.log('pictograms requsesteddddd')
    try {
      const response = yield call(api.fetchPictograms, searchText)
      yield put(pictograms.request(response))
    } catch (error) {
      yield put(pictograms.failure(error.message))
    } finally {
      // When done, we tell Redux we're not in the middle of a request any more
      // yield put({type: SENDING_REQUEST, sending: false})
    }
  }
}

function* autocompleteGetData() {
  while (true) { // eslint-disable-line no-constant-condition
    const { searchText } = yield take(AUTOCOMPLETE.REQUEST)
    try {
      const response = yield call(api.fetchSearches, searchText)
      yield put(autocomplete.request(response))
    } catch (error) {
      yield put(autocomplete.failure(error.message))
    } finally {
      // When done, we tell Redux we're not in the middle of a request any more<commit_msg>fix sagas errors<commit_after>import { take, call, put, fork } from 'redux-saga/effects'
import api from 'services'
import { PICTOGRAMS, pictograms, AUTOCOMPLETE, autocomplete } from './actions'

// Individual exports for testing
export function* defaultSaga() {
  yield fork(pictogramsFlow)
}

function* pictogramsGetData() {
  while (true) { // eslint-disable-line no-constant-condition
    const { payload: { searchText } } = yield take(PICTOGRAMS.REQUEST)
    try {
      const response = yield call(api.fetchPictograms, searchText)
      console.log(response)
      yield put(pictograms.success(response))
    } catch (error) {
      yield put(pictograms.failure(error.message))
    } finally {
      // When done, we tell Redux we're not in the middle of a request any more
      // yield put({type: SENDING_REQUEST, sending: false})
    }
  }
}

function* autocompleteGetData() {
  while (true) { // eslint-disable-line no-constant-condition
    const { payload: { searchText } } = yield take(AUTOCOMPLETE.REQUEST)
    try {
      const response = yield call(api.fetchSearches, searchText)
      console.log(`Respuesta api: ${response}`)
      yield put(autocomplete.success(response))
    } catch (error) {
      yield put(autocomplete.failure(error.message))
    } finally {
      // When done, we tell Redux we're not in the middle of a request any more
{'fraction_non_alphanumeric': 0.11065266316579145, 'fraction_numerical': 0.0, 'mean_word_length': 3.5050675675675675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6872680', 'n_tokens_mistral': 827, 'n_tokens_neox': 801, 'n_words': 225}