about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers/rules.js
blob: 6cc2230bc673138e1d947be13743ea0edc9c7ca8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { RULES_FETCH_SUCCESS } from 'flavours/glitch/actions/rules';
import { List as ImmutableList, fromJS } from 'immutable';

const initialState = ImmutableList();

export default function rules(state = initialState, action) {
  switch (action.type) {
  case RULES_FETCH_SUCCESS:
    return fromJS(action.rules);
  default:
    return state;
  }
}