mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-28 14:04:43 -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
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import { Reducer } from 'redux'
|
||||
import { BannerActions, BannerActionType, BannerState, SetBannerAction } from './types'
|
||||
import { BannerActions, BannerActionType, BannerState } from './types'
|
||||
|
||||
export const initialState: BannerState = {
|
||||
text: undefined,
|
||||
|
@ -18,7 +18,7 @@ export const BannerReducer: Reducer<BannerState, BannerActions> = (
|
|||
) => {
|
||||
switch (action.type) {
|
||||
case BannerActionType.SET_BANNER:
|
||||
return (action as SetBannerAction).state
|
||||
return action.state
|
||||
default:
|
||||
return state
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue