🪛 Data transferring over sockets!

This commit is contained in:
2021-05-27 15:50:03 -07:00
parent 1ca022fd99
commit 79430fdf1e
9 changed files with 119 additions and 25 deletions

View 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;