File size: 323 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import SearchActionTypes from './search-types';
import {fetchSearchData} from '../../Services/SearchService';

export function getSearchData(value) {
  return (dispatch) => {
    fetchSearchData(value).then(data => {
      dispatch({ type: SearchActionTypes.SET_SEARCH_DATA, payload: data.results });
    });
  }
}