Removed unused hashtag redux

• Removed:
- unused hashtag redux
This commit is contained in:
mgabdev 2020-11-09 01:31:32 -06:00
parent 380042cb7a
commit 2d1fdcf6fb
3 changed files with 0 additions and 68 deletions

@ -1,39 +0,0 @@
import api from '../api';
export const HASHTAGS_FETCH_REQUEST = 'HASHTAGS_FETCH_REQUEST';
export const HASHTAGS_FETCH_SUCCESS = 'HASHTAGS_FETCH_SUCCESS';
export const HASHTAGS_FETCH_FAIL = 'HASHTAGS_FETCH_FAIL';
export function fetchHashtags() {
return (dispatch, getState) => {
dispatch(fetchHashtagsRequest());
api(getState).get('/api/v1/trends').then(response => {
dispatch(fetchHashtagsSuccess(response.data));
}).catch(error => dispatch(fetchHashtagsFail(error)));
};
};
export function fetchHashtagsRequest() {
return {
type: HASHTAGS_FETCH_REQUEST,
skipLoading: true,
};
};
export function fetchHashtagsSuccess(tags) {
return {
tags,
type: HASHTAGS_FETCH_SUCCESS,
skipLoading: true,
};
};
export function fetchHashtagsFail(error) {
return {
error,
type: HASHTAGS_FETCH_FAIL,
skipLoading: true,
skipAlert: true,
};
};

@ -1,27 +0,0 @@
import {
HASHTAGS_FETCH_REQUEST,
HASHTAGS_FETCH_SUCCESS,
HASHTAGS_FETCH_FAIL,
} from '../actions/hashtags';
import { Map as ImmutableMap, List as ImmutableList, fromJS } from 'immutable';
const initialState = ImmutableMap({
items: ImmutableList(),
isLoading: false,
});
export default function hashtagsReducer(state = initialState, action) {
switch(action.type) {
case HASHTAGS_FETCH_REQUEST:
return state.set('isLoading', true);
case HASHTAGS_FETCH_SUCCESS:
return state.withMutations(map => {
map.set('items', fromJS(action.tags.map((x => x))))
map.set('isLoading', false);
});
case HASHTAGS_FETCH_FAIL:
return state.set('isLoading', false);
default:
return state;
}
};

@ -12,7 +12,6 @@ import group_categories from './group_categories'
import group_editor from './group_editor'
import group_lists from './group_lists'
import group_relationships from './group_relationships'
import hashtags from './hashtags'
import height_cache from './height_cache'
import links from './links.js'
import lists from './lists'
@ -57,7 +56,6 @@ const reducers = {
group_editor,
group_lists,
group_relationships,
hashtags,
height_cache,
links,
lists,