mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 11:37:02 -04:00
parent
557386f78f
commit
e2155e735d
65 changed files with 834 additions and 467 deletions
23
src/redux/editor/reducers.ts
Normal file
23
src/redux/editor/reducers.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { Reducer } from 'redux'
|
||||
import {
|
||||
EditorConfigActions,
|
||||
EditorConfigState,
|
||||
EditorMode,
|
||||
SET_EDITOR_CONFIG_MODE_ACTION_TYPE
|
||||
} from './types'
|
||||
|
||||
export const initialState: EditorConfigState = {
|
||||
editorMode: EditorMode.PREVIEW
|
||||
}
|
||||
|
||||
export const EditorConfigReducer: Reducer<EditorConfigState, EditorConfigActions> = (state: EditorConfigState = initialState, action: EditorConfigActions) => {
|
||||
switch (action.type) {
|
||||
case SET_EDITOR_CONFIG_MODE_ACTION_TYPE:
|
||||
return {
|
||||
...state,
|
||||
editorMode: action.payload
|
||||
}
|
||||
default:
|
||||
return state
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue