|
| 1 | +import * as types from '../constants/actionTypes.ts'; |
| 2 | + |
| 3 | +export const toggleMode = mode => ({ |
| 4 | + type: types.TOGGLE_MODE, |
| 5 | + payload: mode, |
| 6 | +}); |
| 7 | + |
| 8 | +export const addNewSnapshots = tabsObj => ({ |
| 9 | + type: types.NEW_SNAPSHOTS, |
| 10 | + payload: tabsObj, |
| 11 | +}); |
| 12 | + |
| 13 | +export const initialConnect = tabsObj => ({ |
| 14 | + type: types.INITIAL_CONNECT, |
| 15 | + payload: tabsObj, |
| 16 | +}); |
| 17 | + |
| 18 | +export const setPort = port => ({ |
| 19 | + type: types.SET_PORT, |
| 20 | + payload: port, |
| 21 | +}); |
| 22 | + |
| 23 | +export const emptySnapshots = () => ({ |
| 24 | + type: types.EMPTY, |
| 25 | +}); |
| 26 | + |
| 27 | +export const changeView = index => ({ |
| 28 | + type: types.CHANGE_VIEW, |
| 29 | + payload: index, |
| 30 | +}); |
| 31 | + |
| 32 | +export const changeSlider = index => ({ |
| 33 | + type: types.CHANGE_SLIDER, |
| 34 | + payload: index, |
| 35 | +}); |
| 36 | + |
| 37 | +export const moveBackward = () => ({ |
| 38 | + type: types.MOVE_BACKWARD, |
| 39 | + payload: false, |
| 40 | +}); |
| 41 | + |
| 42 | +export const moveForward = () => ({ |
| 43 | + type: types.MOVE_FORWARD, |
| 44 | + payload: false, |
| 45 | +}); |
| 46 | + |
| 47 | +export const playForward = () => ({ |
| 48 | + type: types.MOVE_FORWARD, |
| 49 | + payload: true, |
| 50 | +}); |
| 51 | + |
| 52 | +export const pause = () => ({ |
| 53 | + type: types.PAUSE, |
| 54 | +}); |
| 55 | + |
| 56 | +export const startPlaying = intervalId => ({ |
| 57 | + type: types.PLAY, |
| 58 | + payload: intervalId, |
| 59 | +}); |
| 60 | + |
| 61 | +export const importSnapshots = newSnaps => ({ |
| 62 | + type: types.IMPORT, |
| 63 | + payload: newSnaps, |
| 64 | +}); |
| 65 | + |
| 66 | +export const setTab = tab => ({ |
| 67 | + type: types.SET_TAB, |
| 68 | + payload: tab, |
| 69 | +}); |
| 70 | + |
| 71 | +export const deleteTab = tab => ({ |
| 72 | + type: types.DELETE_TAB, |
| 73 | + payload: tab, |
| 74 | +}); |
| 75 | + |
| 76 | +export const resetSlider = () => ({ |
| 77 | + type: types.SLIDER_ZERO, |
| 78 | +}); |
0 commit comments