]>
cat aescling's git repositories - mastodon.git/blob - app/javascript/themes/glitch/reducers/height_cache.js
1 import { Map as ImmutableMap
} from 'immutable';
2 import { HEIGHT_CACHE_SET
, HEIGHT_CACHE_CLEAR
} from 'themes/glitch/actions/height_cache';
4 const initialState
= ImmutableMap();
6 const setHeight
= (state
, key
, id
, height
) => {
7 return state
.update(key
, ImmutableMap(), map
=> map
.set(id
, height
));
10 const clearHeights
= () => {
11 return ImmutableMap();
14 export default function statuses(state
= initialState
, action
) {
16 case HEIGHT_CACHE_SET:
17 return setHeight(state
, action
.key
, action
.id
, action
.height
);
18 case HEIGHT_CACHE_CLEAR:
19 return clearHeights();
This page took 0.074309 seconds and 4 git commands to generate.