mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 02:35:23 -04:00
Reorganize redux types to avoid unnecessary type casting
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
a221ce4255
commit
6a43d0c5fb
27 changed files with 113 additions and 153 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
import { Reducer } from 'redux'
|
||||
import { Config } from '../../api/config/types'
|
||||
import { ConfigActions, ConfigActionType, SetConfigAction } from './types'
|
||||
import { ConfigActions, ConfigActionType } from './types'
|
||||
|
||||
export const initialState: Config = {
|
||||
allowAnonymous: true,
|
||||
|
@ -55,7 +55,7 @@ export const initialState: Config = {
|
|||
export const ConfigReducer: Reducer<Config, ConfigActions> = (state: Config = initialState, action: ConfigActions) => {
|
||||
switch (action.type) {
|
||||
case ConfigActionType.SET_CONFIG:
|
||||
return (action as SetConfigAction).state
|
||||
return action.state
|
||||
default:
|
||||
return state
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue