swimtracker-app/state/ActionCreators.js

37 lines
913 B
JavaScript
Raw Normal View History

2020-06-02 17:19:09 +02:00
export const NEW_DEVICE_DATA = "NEW_DEVICE_DATA";
export const CHANGE_USER_NAME = "SET_USERNAME";
export const CHANGE_THEME = "CHANGE_THEME";
export const START_SESSION = "START_SESSION";
2020-06-02 22:43:48 +02:00
export const STOP_SESSION = "STOP_SESSION";
2020-06-23 21:36:14 +02:00
export const RESET_DEVICE_DATA = "RESET_DEVICE_DATA";
2020-06-02 17:19:09 +02:00
export const reportDeviceData = (sessionId, newDataStart, data, analysis) => ({
type: NEW_DEVICE_DATA,
sessionId: sessionId,
newDataStart: newDataStart,
data: data,
analysis: analysis,
})
2020-06-23 21:36:14 +02:00
export const resetDeviceData = () => ({
type: RESET_DEVICE_DATA,
});
2020-06-02 17:19:09 +02:00
export const changeUsername = newUsername => ({
type: CHANGE_USER_NAME,
newUserName: newUsername,
})
export const changeTheme = newThemeName => ({
type: CHANGE_THEME,
newThemeName: newThemeName
})
export const startSession = () => ({
type: START_SESSION
2020-06-02 22:43:48 +02:00
})
export const stopSession = () => ({
type: STOP_SESSION
2020-06-02 17:19:09 +02:00
})