From 0a7ae631cd72100abdc26b84b06006bb5b166cba Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 2 Oct 2017 21:35:52 +0900 Subject: follow as redux --- src/actions/follow.js | 29 +++++++++++++++++++++++++++++ src/actions/index.js | 6 ++++++ 2 files changed, 35 insertions(+) create mode 100644 src/actions/follow.js (limited to 'src/actions') diff --git a/src/actions/follow.js b/src/actions/follow.js new file mode 100644 index 0000000..7ab689e --- /dev/null +++ b/src/actions/follow.js @@ -0,0 +1,29 @@ +import actions from '../actions'; + +const enable = (newTab) => { + return { + type: actions.FOLLOW_ENABLE, + newTab, + }; +}; + +const disable = () => { + return { + type: actions.FOLLOW_DISABLE, + }; +}; + +const keyPress = (key) => { + return { + type: actions.FOLLOW_KEY_PRESS, + key: key + }; +}; + +const backspace = () => { + return { + type: actions.FOLLOW_BACKSPACE, + }; +}; + +export { enable, disable, keyPress, backspace }; diff --git a/src/actions/index.js b/src/actions/index.js index 63c36d2..4e8d4a7 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -17,4 +17,10 @@ export default { // Settings SETTING_SET_SETTINGS: 'setting.set.settings', + + // Follow + FOLLOW_ENABLE: 'follow.enable', + FOLLOW_DISABLE: 'follow.disable', + FOLLOW_KEY_PRESS: 'follow.key.press', + FOLLOW_BACKSPACE: 'follow.backspace', }; -- cgit v1.2.3