Cosmetic (reformat)
This commit is contained in:
parent
db0761efd1
commit
4bbb642b41
|
@ -30,10 +30,7 @@ setupIonicReact();
|
||||||
const App: React.FC = () => (
|
const App: React.FC = () => (
|
||||||
<IonApp>
|
<IonApp>
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<Slippy />
|
|
||||||
<Layer>
|
|
||||||
<TiledMap />
|
|
||||||
</Layer>
|
|
||||||
</Provider>
|
</Provider>
|
||||||
</IonApp>
|
</IonApp>
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,20 +8,19 @@ import Slippy from '../slippy/slippy';
|
||||||
import TiledMap from './tiled-map';
|
import TiledMap from './tiled-map';
|
||||||
|
|
||||||
const Map: react.FC<{}> = (props: {}) => {
|
const Map: react.FC<{}> = (props: {}) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const resizeHandler = () => {
|
const resizeHandler = () => {
|
||||||
dispatch(mapActions.resize());
|
dispatch(mapActions.resize());
|
||||||
};
|
};
|
||||||
const debouncedResizeHandler = useMemo(
|
const debouncedResizeHandler = useMemo(
|
||||||
() => _.debounce(resizeHandler, 500),
|
() => _.debounce(resizeHandler, 500),
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.addEventListener('resize', debouncedResizeHandler);
|
window.addEventListener('resize', debouncedResizeHandler);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
|
|
@ -105,7 +105,9 @@ const mapSlice = createSlice({
|
||||||
resize: (state) => {
|
resize: (state) => {
|
||||||
return computeStateFromScope(state.scope);
|
return computeStateFromScope(state.scope);
|
||||||
},
|
},
|
||||||
shift: (state, action) => {},
|
shift: (state, action) => {
|
||||||
|
|
||||||
|
},
|
||||||
scale: (state, action) => {},
|
scale: (state, action) => {},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue