🚨 Make ts linter less depressed
This commit is contained in:
@@ -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.`);
|
||||
|
Reference in New Issue
Block a user