*Not* using redux for mouseState.
This commit is contained in:
1 parent
3421686f1f
commit
ec0883ac54
3 files changed
+25
-54
No files matched your search
+1
-2
@@ -1,10 +1,9 @@
|
||||
import { configureStore } from '@reduxjs/toolkit';
|
||||
|
||||
import slippyReducer from './slippy';
|
||||
import mouseHandlerReducer from './mouse-handler';
|
||||
|
||||
const store = configureStore({
|
||||
reducer: { slippy: slippyReducer, mouseHandler: mouseHandlerReducer },
|
||||
reducer: { slippy: slippyReducer},
|
||||
});
|
||||
|
||||
export default store;
|
||||
@@ -1,25 +0,0 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
|
||||
const initialMouseState = {
|
||||
down: false,
|
||||
starting: { x: -1, y: -1 },
|
||||
timestamp:0,
|
||||
};
|
||||
|
||||
const mouseHandlerSlice = createSlice({
|
||||
name: 'mouseHandler',
|
||||
initialState: initialMouseState,
|
||||
reducers: {
|
||||
init(state) {
|
||||
return initialMouseState;
|
||||
},
|
||||
set(state, action) {
|
||||
return action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const mouseHandlerActions = mouseHandlerSlice.actions;
|
||||
|
||||
export default mouseHandlerSlice.reducer;
|
||||
Reference in new issue
Block a user