Display list column (#5750)

This commit is contained in:
Eugen Rochko 2017-11-25 00:35:37 +01:00 committed by GitHub
parent 269a445c0b
commit 31ac5f0e00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 166 additions and 1 deletions

View file

@ -22,6 +22,7 @@ import media_attachments from './media_attachments';
import notifications from './notifications';
import height_cache from './height_cache';
import custom_emojis from './custom_emojis';
import lists from './lists';
const reducers = {
timelines,
@ -47,6 +48,7 @@ const reducers = {
notifications,
height_cache,
custom_emojis,
lists,
};
export default combineReducers(reducers);

View file

@ -0,0 +1,15 @@
import { LIST_FETCH_SUCCESS } from '../actions/lists';
import { Map as ImmutableMap, fromJS } from 'immutable';
const initialState = ImmutableMap();
const normalizeList = (state, list) => state.set(list.id, fromJS(list));
export default function lists(state = initialState, action) {
switch(action.type) {
case LIST_FETCH_SUCCESS:
return normalizeList(state, action.list);
default:
return state;
}
};