File size: 465 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { DRAWER_PREROUTE_SET, SetDrawerPreRouteResponse } from '../actions/set-drawer-preroute.js'

export type DrawerInState = SetDrawerPreRouteResponse['data']

export const drawerReducer = (
  state: DrawerInState = { previousRoute: null },
  action: {
    type: string
    data: DrawerInState
  },
) => {
  switch (action.type) {
  case DRAWER_PREROUTE_SET: {
    return {
      ...state,
      ...action.data,
    }
  }
  default: {
    return state
  }
  }
}