aboutsummaryrefslogtreecommitdiff
path: root/src/background/actions
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-05-06 16:11:40 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-05-06 16:35:48 +0900
commit2c366ac3b1d7114869567845c955238e96056565 (patch)
treed98e96b4ee70c410ca1f84784013dc6a17bce3dd /src/background/actions
parent98bc2326eeeb5d915706dee9aadc2ac3e9af1789 (diff)
Previous selected tab as redux
Diffstat (limited to 'src/background/actions')
-rw-r--r--src/background/actions/index.js3
-rw-r--r--src/background/actions/tab.js11
2 files changed, 13 insertions, 1 deletions
diff --git a/src/background/actions/index.js b/src/background/actions/index.js
index 2bdaaf2..3833389 100644
--- a/src/background/actions/index.js
+++ b/src/background/actions/index.js
@@ -5,4 +5,7 @@ export default {
// Find
FIND_SET_KEYWORD: 'find.set.keyword',
+
+ // Tab
+ TAB_SELECTED: 'tab.selected',
};
diff --git a/src/background/actions/tab.js b/src/background/actions/tab.js
index 3c642fd..0d439fd 100644
--- a/src/background/actions/tab.js
+++ b/src/background/actions/tab.js
@@ -1,3 +1,5 @@
+import actions from './index';
+
const openNewTab = (url, openerTabId, background = false, adjacent = false) => {
if (adjacent) {
return browser.tabs.query({
@@ -18,4 +20,11 @@ const openToTab = (url, tab) => {
return browser.tabs.update(tab.id, { url: url });
};
-export { openNewTab, openToTab };
+const selected = (tabId) => {
+ return {
+ type: actions.TAB_SELECTED,
+ tabId,
+ };
+};
+
+export { openNewTab, openToTab, selected };