diff options
| author | Thomas Haddad | 2016-11-14 17:34:16 +0100 |
|---|---|---|
| committer | Thomas Haddad | 2016-11-14 17:34:16 +0100 |
| commit | 4ca77b550a4e44d73f07f43e7481b340e1ae0de3 (patch) | |
| tree | 1cdba4e699b7f202814b8e5f2cd01ccc50014c71 /app/assets/javascripts | |
| parent | 76445901cb5aa71e9847605cf9f499026d356c4e (diff) | |
| download | chouette-core-4ca77b550a4e44d73f07f43e7481b340e1ae0de3.tar.bz2 | |
Fix imports gardening
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
Diffstat (limited to 'app/assets/javascripts')
| -rw-r--r-- | app/assets/javascripts/es6_browserified/actions/index.js | 60 | ||||
| -rw-r--r-- | app/assets/javascripts/es6_browserified/containers/VisibleTodoList.js | 10 |
2 files changed, 37 insertions, 33 deletions
diff --git a/app/assets/javascripts/es6_browserified/actions/index.js b/app/assets/javascripts/es6_browserified/actions/index.js index 41d57d28c..b92f9c913 100644 --- a/app/assets/javascripts/es6_browserified/actions/index.js +++ b/app/assets/javascripts/es6_browserified/actions/index.js @@ -1,30 +1,34 @@ -export const addStop = () => { - return { - type: 'ADD_STOP' - } -} -export const moveStopUp = (index) => { - return { - type: 'MOVE_STOP_UP', - index - } -} -export const moveStopDown = (index) => { - return { - type: 'MOVE_STOP_DOWN', - index - } -} -export const deleteStop = (index) => { - return { - type: 'DELETE_STOP', - index - } -} -export const updateInputValue = (index, text) => { - return { - type : "UPDATE_INPUT_VALUE", - index, - text +const actions = { + addStop : () => { + return { + type: 'ADD_STOP' + } + }, + moveStopUp : (index) => { + return { + type: 'MOVE_STOP_UP', + index + } + }, + moveStopDown : (index) => { + return { + type: 'MOVE_STOP_DOWN', + index + } + }, + deleteStop : (index) => { + return { + type: 'DELETE_STOP', + index + } + }, + updateInputValue : (index, text) => { + return { + type : "UPDATE_INPUT_VALUE", + index, + text + } } } + +export default actions diff --git a/app/assets/javascripts/es6_browserified/containers/VisibleTodoList.js b/app/assets/javascripts/es6_browserified/containers/VisibleTodoList.js index 7fb92bba5..4bb4e6c05 100644 --- a/app/assets/javascripts/es6_browserified/containers/VisibleTodoList.js +++ b/app/assets/javascripts/es6_browserified/containers/VisibleTodoList.js @@ -1,4 +1,4 @@ -import {toggleTodo, deleteStop, moveStopUp, moveStopDown, updateInputValue} from '../actions' +import actions from '../actions' import { connect } from 'react-redux' import TodoList from '../components/TodoList' @@ -11,16 +11,16 @@ const mapStateToProps = (state) => { const mapDispatchToProps = (dispatch) => { return { onDeleteClick: (index) =>{ - dispatch(deleteStop(index)) + dispatch(actions.deleteStop(index)) }, onMoveUpClick: (index) =>{ - dispatch(moveStopUp(index)) + dispatch(actions.moveStopUp(index)) }, onMoveDownClick: (index) =>{ - dispatch(moveStopDown(index)) + dispatch(actions.moveStopDown(index)) }, onChange: (index, text) =>{ - dispatch(updateInputValue(index, text)) + dispatch(actions.updateInputValue(index, text)) } } } |
