Preview: sessionReducer.ts
Size: 431 B
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/frontend/store/reducers/sessionReducer.ts
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
}
}
Directory Contents
Dirs: 0 × Files: 16