Cosmetic (reformat)

This commit is contained in:
Eric van der Vlist 2022-09-14 10:03:49 +02:00
parent db0761efd1
commit 4bbb642b41
3 changed files with 17 additions and 19 deletions

View File

@ -30,10 +30,7 @@ setupIonicReact();
const App: React.FC = () => (
<IonApp>
<Provider store={store}>
<Slippy />
<Layer>
<TiledMap />
</Layer>
</Provider>
</IonApp>
);

View File

@ -8,20 +8,19 @@ import Slippy from '../slippy/slippy';
import TiledMap from './tiled-map';
const Map: react.FC<{}> = (props: {}) => {
const dispatch = useDispatch();
const dispatch = useDispatch();
const resizeHandler = () => {
dispatch(mapActions.resize());
};
const debouncedResizeHandler = useMemo(
() => _.debounce(resizeHandler, 500),
[]
);
useEffect(() => {
window.addEventListener('resize', debouncedResizeHandler);
}, []);
const resizeHandler = () => {
dispatch(mapActions.resize());
};
const debouncedResizeHandler = useMemo(
() => _.debounce(resizeHandler, 500),
[]
);
useEffect(() => {
window.addEventListener('resize', debouncedResizeHandler);
}, []);
return (
<Fragment>

View File

@ -105,7 +105,9 @@ const mapSlice = createSlice({
resize: (state) => {
return computeStateFromScope(state.scope);
},
shift: (state, action) => {},
shift: (state, action) => {
},
scale: (state, action) => {},
},
});