diff options
| author | Kamran Ahmed <kamranahmed.se@gmail.com> | 2018-08-19 22:03:55 +0400 |
|---|---|---|
| committer | Kamran Ahmed <kamranahmed.se@gmail.com> | 2018-08-19 22:03:55 +0400 |
| commit | 254cd213af29779b69447e0c53fa58d7a20a3a95 (patch) | |
| tree | b2dc799b2b7dfb016d0c782854f8c0a73fb5d066 /src/redux/github/actions.js | |
| parent | Add axios and reducer for github (diff) | |
| download | githunt-254cd213af29779b69447e0c53fa58d7a20a3a95.tar.gz | |
Add update filters action
Diffstat (limited to 'src/redux/github/actions.js')
| -rw-r--r-- | src/redux/github/actions.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/redux/github/actions.js b/src/redux/github/actions.js index 2db93ce..7f843c4 100644 --- a/src/redux/github/actions.js +++ b/src/redux/github/actions.js @@ -3,7 +3,8 @@ import axios from 'axios'; import { FETCH_TRENDING_FAILED, FETCH_TRENDING_SUCCESS, - PROCESS_FETCH_TRENDING + PROCESS_FETCH_TRENDING, + UPDATE_FILTERS } from './types'; const API_URL = 'https://api.github.com/search/repositories'; @@ -31,3 +32,17 @@ export const fetchTrending = function (filters) { }); }; }; + +/** + * Updates the filters used in queries + * @param filters + * @return {Function} + */ +export const updateFilters = function (filters) { + return dispatch => { + dispatch({ + type: UPDATE_FILTERS, + payload: filters + }); + }; +}; |
