Reorganize redux types to avoid unnecessary type casting

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-07-21 22:52:49 +02:00
parent a221ce4255
commit 6a43d0c5fb
27 changed files with 113 additions and 153 deletions

View file

@ -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
}