Progress
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
TRENDS_FETCH_REQUEST,
|
||||
TRENDS_FETCH_SUCCESS,
|
||||
TRENDS_FETCH_FAIL,
|
||||
} from '../actions/trends';
|
||||
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({
|
||||
@@ -10,16 +10,16 @@ const initialState = ImmutableMap({
|
||||
isLoading: false,
|
||||
});
|
||||
|
||||
export default function trendsReducer(state = initialState, action) {
|
||||
export default function hashtagsReducer(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case TRENDS_FETCH_REQUEST:
|
||||
case HASHTAGS_FETCH_REQUEST:
|
||||
return state.set('isLoading', true);
|
||||
case TRENDS_FETCH_SUCCESS:
|
||||
case HASHTAGS_FETCH_SUCCESS:
|
||||
return state.withMutations(map => {
|
||||
map.set('items', fromJS(action.tags.map((x => x))))
|
||||
map.set('isLoading', false);
|
||||
});
|
||||
case TRENDS_FETCH_FAIL:
|
||||
case HASHTAGS_FETCH_FAIL:
|
||||
return state.set('isLoading', false);
|
||||
default:
|
||||
return state;
|
||||
@@ -31,7 +31,7 @@ import conversations from './conversations';
|
||||
import suggestions from './suggestions';
|
||||
import polls from './polls';
|
||||
import identity_proofs from './identity_proofs';
|
||||
import trends from './trends';
|
||||
import hashtags from './hashtags';
|
||||
import groups from './groups';
|
||||
import group_relationships from './group_relationships';
|
||||
import group_lists from './group_lists';
|
||||
@@ -72,7 +72,7 @@ const reducers = {
|
||||
conversations,
|
||||
suggestions,
|
||||
polls,
|
||||
trends,
|
||||
hashtags,
|
||||
groups,
|
||||
group_relationships,
|
||||
group_lists,
|
||||
|
||||
Reference in New Issue
Block a user