aboutsummaryrefslogtreecommitdiff
path: root/src/background/reducers/tab.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/reducers/tab.js')
-rw-r--r--src/background/reducers/tab.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/background/reducers/tab.js b/src/background/reducers/tab.js
new file mode 100644
index 0000000..e0cdf32
--- /dev/null
+++ b/src/background/reducers/tab.js
@@ -0,0 +1,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;
+ }
+}
+