2018-05-15 16:50:21 +02:00
|
|
|
/* @flow */
|
2018-05-23 18:03:26 +02:00
|
|
|
import type {
|
|
|
|
ResetSimulationAction,
|
|
|
|
LoadPreviousSimulationAction
|
|
|
|
} from './types/Actions'
|
2018-05-15 16:50:21 +02:00
|
|
|
|
2017-01-10 19:22:44 +01:00
|
|
|
// The input "conversation" is composed of "steps"
|
|
|
|
// The state keeps track of which of them have been submitted
|
|
|
|
// The user can also come back to one of his answers and edit it
|
|
|
|
export const STEP_ACTION = 'STEP_ACTION'
|
2018-05-15 16:50:21 +02:00
|
|
|
|
|
|
|
// $FlowFixMe
|
2018-01-30 14:50:47 +01:00
|
|
|
export function stepAction(name, step, source) {
|
|
|
|
return { type: STEP_ACTION, name, step, source }
|
2017-01-10 19:22:44 +01:00
|
|
|
}
|
|
|
|
|
2018-05-15 16:50:21 +02:00
|
|
|
export function resetSimulation(): ResetSimulationAction {
|
|
|
|
return {
|
|
|
|
type: 'RESET_SIMULATION'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// $FlowFixMe
|
2018-06-13 10:26:27 +02:00
|
|
|
export function setExample(name, situation, dottedName) {
|
|
|
|
return { type: 'SET_EXAMPLE', name, situation, dottedName }
|
2018-02-22 17:23:47 +01:00
|
|
|
}
|
|
|
|
|
2017-01-10 19:22:44 +01:00
|
|
|
export const START_CONVERSATION = 'START_CONVERSATION'
|
|
|
|
|
|
|
|
export const CHANGE_THEME_COLOUR = 'CHANGE_THEME_COLOUR'
|
2018-05-15 16:50:21 +02:00
|
|
|
|
2018-05-23 18:03:26 +02:00
|
|
|
export function loadPreviousSimulation(): LoadPreviousSimulationAction {
|
|
|
|
return {
|
|
|
|
type: 'LOAD_PREVIOUS_SIMULATION'
|
|
|
|
}
|
|
|
|
}
|
2018-05-15 16:50:21 +02:00
|
|
|
// $FlowFixMe
|
2018-01-03 16:54:19 +01:00
|
|
|
export function changeThemeColour(colour) {
|
|
|
|
return { type: CHANGE_THEME_COLOUR, colour }
|
|
|
|
}
|
2017-02-08 17:50:22 +01:00
|
|
|
|
2017-02-09 18:15:25 +01:00
|
|
|
export const EXPLAIN_VARIABLE = 'EXPLAIN_VARIABLE'
|
2018-03-29 13:38:55 +02:00
|
|
|
export const CHANGE_LANG = 'CHANGE_LANG'
|