import { Component, createEffect, createResource, For } from 'solid-js'; import OlMap from 'ol/Map'; import dispatch from '../../workers/dispatcher-main'; import Trk from '../trk'; import getUri from '../../lib/ids'; interface Props { gpxId: string; map: () => OlMap | null; } export const Gpx: Component = ({ map, gpxId }) => { const [gpx] = createResource( gpxId, async () => await dispatch({ action: 'getGpx', params: { id: gpxId, }, }) ); createEffect(() => { console.log({ caller: 'Gpx', map: map(), gpxId, gpx: gpx() }); }); return ( // @ts-ignore {(trkId: string) => { console.log({ caller: 'Gpx / loop', trkId }); return ; }} ); }; export default Gpx;