File size: 431 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import type { CurrentAdmin } from '../../../current-admin.interface.js'
import { SESSION_INITIALIZE } from '../actions/set-current-admin.js'

export type SessionInState = CurrentAdmin | null

export const sessionReducer = (
  state: SessionInState = null,
  action: {
    type: string
    data: SessionInState
  },
) => {
  switch (action.type) {
  case SESSION_INITIALIZE:
    return action.data
  default:
    return state
  }
}