<Trk> component

This commit is contained in:
vdv committed 2022-11-27 16:09:08 +01:00
1 parent 79fb39100f
commit 54f2ab06d9
6 files changed
+65 -10

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
import { Component, createEffect, createResource } from 'solid-js';
import OlMap from 'ol/Map';
import dispatch from '../../workers/dispatcher-main';
import getUri from '../../lib/ids';
//import Trkseg from './Trkseg';
interface Props {
trkId: string;
map: () => OlMap | null;
}
export const Trk: Component<Props> = ({ map, trkId }) => {
const [trk] = createResource(
trkId,
async () =>
await dispatch({
action: 'getTrk',
params: {
id: trkId,
},
})
);
createEffect(() => {
console.log({ caller: 'Trk', map: map(), trkId, trk: trk() });
});
return <></>;
};
export default Trk;
+1
View File
@@ -0,0 +1 @@
export { default } from './Trk';