From 082450928a35ea8d35fdbcd176dbd972e45acfec Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 13 Aug 2017 12:00:39 +0900 Subject: use key-queue for input --- src/shared/actions.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/shared/actions.js (limited to 'src/shared') diff --git a/src/shared/actions.js b/src/shared/actions.js new file mode 100644 index 0000000..2e10810 --- /dev/null +++ b/src/shared/actions.js @@ -0,0 +1,22 @@ +export const TABS_PREV = 'tabs.prev'; +export const TABS_NEXT = 'tabs.next'; +export const SCROLL_UP = 'scroll.up'; +export const SCROLL_DOWN = 'scroll.down'; + +const BACKGROUND_ACTION_SET = new Set([ + TABS_PREV, + TABS_NEXT +]); + +const CONTENT_ACTION_SET = new Set([ + SCROLL_UP, + SCROLL_DOWN +]); + +export const isBackgroundAction = (action) => { + return BACKGROUND_ACTION_SET.has(action); +}; + +export const isContentAction = (action) => { + return CONTENT_ACTION_SET.has(action); +}; -- cgit v1.2.3