aboutsummaryrefslogtreecommitdiff
path: root/src/background/reducers/tab.js
blob: e0cdf32288ead2876008c2f6df20cc62bf7ab07a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import actions from 'background/actions';

const defaultState = {
  previousSelected: -1,
  currentSelected: -1,
};

export default function reducer(state = defaultState, action = {}) {
  switch (action.type) {
  case actions.TAB_SELECTED:
    return {
      previousSelected: state.currentSelected,
      currentSelected: action.tabId,
    };
  default:
    return state;
  }
}