- added functionality to save sighting sessions to black board
This commit is contained in:
20
src/context/reducers/NPEDContextReducer.ts
Normal file
20
src/context/reducers/NPEDContextReducer.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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 };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user