🪛 Data transferring over sockets!
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { CV_API_CALL_IN_PROGRESS, CV_SEARCH_SUCCESS } from "../constants/action-types";
|
||||
import {
|
||||
CV_API_CALL_IN_PROGRESS,
|
||||
CV_SEARCH_SUCCESS,
|
||||
} from "../constants/action-types";
|
||||
const initialState = {
|
||||
showResultsPane: false,
|
||||
};
|
||||
|
||||
function comicinfoReducer(state = initialState, action){
|
||||
function comicinfoReducer(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case CV_API_CALL_IN_PROGRESS:
|
||||
return {
|
||||
|
||||
25
src/client/reducers/fileops.reducer.ts
Normal file
25
src/client/reducers/fileops.reducer.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import {
|
||||
IMS_SOCKET_CONNECTION_CONNECTED,
|
||||
IMS_SOCKET_CONNECTION_DISCONNECTED,
|
||||
IMS_SOCKET_DATA_FETCHED,
|
||||
IMS_SOCKET_ERROR,
|
||||
} from "../constants/action-types";
|
||||
const initialState = {
|
||||
dataTransferred: false,
|
||||
comicBookMetadata: [],
|
||||
};
|
||||
|
||||
function fileOpsReducer(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case IMS_SOCKET_DATA_FETCHED:
|
||||
return {
|
||||
...state,
|
||||
comicBookMetadata: [...state.comicBookMetadata, action.data.data],
|
||||
dataTransferred: true,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
export default fileOpsReducer;
|
||||
@@ -1,9 +1,11 @@
|
||||
import { combineReducers } from "redux";
|
||||
import { connectRouter } from "connected-react-router";
|
||||
import comicinfoReducer from "../reducers/comicinfo.reducer";
|
||||
import fileOpsReducer from "../reducers/fileops.reducer";
|
||||
|
||||
export default (history) =>
|
||||
combineReducers({
|
||||
comicInfo: comicinfoReducer,
|
||||
fileOps: fileOpsReducer,
|
||||
router: connectRouter(history),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user