currentPoiSlice als Redux Slice implementiert statt Recoil atom
This commit is contained in:
@@ -1,18 +1,9 @@
|
||||
// /redux/reducer.js
|
||||
const initialState = {
|
||||
messages: [],
|
||||
};
|
||||
// redux/reducer.js
|
||||
import { combineReducers } from "redux";
|
||||
import currentPoiReducer from "./slices/currentPoiSlice";
|
||||
|
||||
const websocketReducer = (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case "WS_MESSAGE_RECEIVED":
|
||||
return {
|
||||
...state,
|
||||
messages: [...state.messages, action.payload],
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
const rootReducer = combineReducers({
|
||||
currentPoi: currentPoiReducer,
|
||||
});
|
||||
|
||||
export default websocketReducer;
|
||||
export default rootReducer;
|
||||
|
||||
Reference in New Issue
Block a user