Skip to content

Commit

Permalink
reducer code for SET_CONVERSION_ENGINE
Browse files Browse the repository at this point in the history
  • Loading branch information
interim17 committed Oct 5, 2023
1 parent 13b0c30 commit b9017a7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/state/trajectory/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import {
CLEAR_SIMULARIUM_FILE,
SET_CONVERSION_TEMPLATE,
RECEIVE_FILE_TO_CONVERT,
SET_CONVERSION_ENGINE,
} from "./constants";
import {
TrajectoryStateBranch,
ReceiveAction,
ClearSimFileDataAction,
SetConversionTemplateData,
ReceiveFileToConvertAction,
SetConversionEngineAction,
} from "./types";

export const initialState = {
Expand Down Expand Up @@ -97,6 +99,20 @@ const actionToConfigMap: TypeToDescriptionMap = {
},
}),
},
[SET_CONVERSION_ENGINE]: {
accepts: (action: AnyAction): action is SetConversionEngineAction =>
action.type === SET_CONVERSION_ENGINE,
perform: (
state: TrajectoryStateBranch,
action: SetConversionEngineAction
) => ({
...state,
processingData: {
...state.processingData,
engineType: action.payload,
},
}),
},
[RECEIVE_FILE_TO_CONVERT]: {
accepts: (action: AnyAction): action is ReceiveFileToConvertAction =>
action.type === RECEIVE_FILE_TO_CONVERT,
Expand Down

0 comments on commit b9017a7

Please sign in to comment.