Files
Mav-Mobile-UI/src/context/reducers/NPEDContextReducer.ts

21 lines
426 B
TypeScript
Raw Normal View History

import type { NPEDACTION, NPEDSTATE } from "../../types/types";
export const initialState = {
sessionStarted: false,
sessionList: [],
sessionPaused: false,
savedSightings: [],
};
export function reducer(state: NPEDSTATE, action: NPEDACTION) {
switch (action.type) {
case "SESSION":
return {
...state,
sessionStarted: action.payload,
};
default:
return { ...state };
}
}