🚨 Make ts linter less depressed

This commit is contained in:
2023-01-28 16:27:40 +01:00
parent 29ba26e80b
commit 43cbfc17b6
6 changed files with 113 additions and 50 deletions

View File

@@ -7,11 +7,11 @@ import { Passages, Stops } from './types';
interface Store {
passages: () => Passages;
getLinePassages?: (lineId: string) => Passages;
addPassages?: (passages) => void;
addPassages?: (passages: Passages) => void;
clearPassages?: () => void;
stops: () => Stops;
addStops?: (stops) => void;
addStops?: (stops: Stops) => void;
};
export const BusinessDataContext = createContext<Store>();
@@ -22,7 +22,7 @@ export function BusinessDataProvider(props: { children: JSX.Element }) {
const [store, setStore] = createStore({ lines: {}, passages: {}, stops: {} });
async function getLine(lineId: number) {
const getLine: Line = async (lineId: string) => {
let line = store.lines[lineId];
if (line === undefined) {
console.log(`${lineId} not found... fetch it from backend.`);