1234567891011121314151617181920 |
- import { createContext } from "react";
- import { getDateString } from '../utils/date';
- type AppContextType = {
- selectedDate: number,
- setSelectedDate: (selectedDate: number) => void,
- calorieItems: CalorieItems;
- setCalorieItems: (calorieItems: CalorieValue[]) => void;
- };
- const AppContext = createContext<AppContextType>({
- calorieItems: [],
- selectedDate: Date.now(),
- setCalorieItems: () => [],
- setSelectedDate: () => getDateString(new Date())
- });
- export {
- AppContext
- };
|